上一页 1 2 3 4 5 6 ··· 19 下一页
摘要: Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given num = 5, return fa 阅读全文
posted @ 2016-11-23 15:27 破玉 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of three. Follow up:Could you do it without using any loop / recursion? 阅读全文
posted @ 2016-11-22 11:16 破玉 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Reverse a singly linked list. 阅读全文
posted @ 2016-11-21 10:51 破玉 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 此题是求阶乘后面零的个数。 阅读全文
posted @ 2016-11-20 09:04 破玉 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
posted @ 2016-11-19 11:22 破玉 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 在处理一道题目是,发现他们使用了List 中的set 方法,这个方法我平时很少用到,今天来研究一下,set和add的区别 add(int index,Object obj)方法与set(int index,Object e) 我们写一个例子: 结果: 阅读全文
posted @ 2016-11-18 11:47 破玉 阅读(5719) 评论(0) 推荐(1) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2016-11-18 11:10 破玉 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 参考博客:链表环状检测 阅读全文
posted @ 2016-11-17 19:59 破玉 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algorithm to us 阅读全文
posted @ 2016-11-16 10:02 破玉 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return solution: 阅读全文
posted @ 2016-11-14 10:25 破玉 阅读(384) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 19 下一页