Fork me on GitHub
摘要: main.cpp/************************************************ Problem: 队列中取最大值操作* 1.EnQueue(V): 将V加入队列中* 2.DeQueue(): 使队列中首元素删除并返回此元素* 3.MaxElement(): 返回对列中的最大元素** Solution:* 利用两个栈实现队列,在栈中实现取最大元素的操作*************************************************/#include <iostream>#include "Stack.h"#in 阅读全文
posted @ 2012-04-29 02:31 _Lei 阅读(1073) 评论(0) 推荐(0) 编辑
摘要: 今天在园子里面看到有人讨论小米笔试题的解法,好吧,我不知道小米已经笔试了,自己看了一下,试着用线段树解决,没想到掌握得还不够牢固啊.....最终还是解决了/********************************************Problem: * 一条直线有n个线段,知道首尾坐标,* 求线段总长度,重叠部分按一次算 * struct s{int start;int end;}*Author: Lei*Bolg: http://www.cnblogs.com/-Lei/********************************************/#... 阅读全文
posted @ 2012-04-29 02:25 _Lei 阅读(2541) 评论(2) 推荐(2) 编辑