上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 98 下一页
摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-11-14 09:09 Jessica程序猿 阅读(178) 评论(0) 推荐(0)
摘要: Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal... 阅读全文
posted @ 2014-11-14 09:06 Jessica程序猿 阅读(190) 评论(0) 推荐(0)
摘要: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo... 阅读全文
posted @ 2014-11-13 21:36 Jessica程序猿 阅读(164) 评论(0) 推荐(0)
摘要: GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1]... 阅读全文
posted @ 2014-11-13 18:36 Jessica程序猿 阅读(235) 评论(0) 推荐(0)
摘要: Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(... 阅读全文
posted @ 2014-11-13 17:29 Jessica程序猿 阅读(160) 评论(0) 推荐(0)
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2014-11-13 16:35 Jessica程序猿 阅读(163) 评论(0) 推荐(0)
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2014-11-13 15:53 Jessica程序猿 阅读(269) 评论(0) 推荐(0)
摘要: 昨天笔试遇到个 关于类占用的空间大小的问题,以前没怎么重视,回来做个试验,还真发现了问题,以后各位笔试考官门,出题时请注明是用什么编译器。 vc6/vc8 cl 和 Dev-C 的g++ 来做的测试:上代码,测试代码:#include class A{public:int x; int y;A(){... 阅读全文
posted @ 2014-11-13 10:31 Jessica程序猿 阅读(776) 评论(0) 推荐(0)
摘要: 重复继承下面我们再来看看,发生重复继承的情况。所谓重复继承,也就是某个基类被间接地重复继承了多次。下图是一个继承图,我们重载了父类的f()函数。其类继承的源代码如下所示。其中,每个类都有两个变量,一个是整形(4字节),一个是字符(1字节),而且还有自己的虚函数,自己overwrite父类的虚函数。如... 阅读全文
posted @ 2014-11-12 21:27 Jessica程序猿 阅读(265) 评论(0) 推荐(0)
摘要: 前言07年12月,我写了一篇《C++虚函数表解析》的文章,引起了大家的兴趣。有很多朋友对我的文章留了言,有鼓励我的,有批评我的,还有很多问问题的。我在这里一并对大家的留言表示感谢。这也是我为什么再写一篇续言的原因。因为,在上一篇文章中,我用了的示例都是非常简单的,主要是为了说明一些机理上的问题,也是... 阅读全文
posted @ 2014-11-12 21:11 Jessica程序猿 阅读(225) 评论(0) 推荐(0)
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 98 下一页