Fork me on GitHub
上一页 1 2 3 4 5 6 7 ··· 22 下一页
摘要: 题目: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total 阅读全文
posted @ 2016-02-29 20:12 __Neo 阅读(1119) 评论(0) 推荐(0) 编辑
摘要: 题目: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may co 阅读全文
posted @ 2016-02-29 16:54 __Neo 阅读(4156) 评论(2) 推荐(1) 编辑
摘要: 题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique 阅读全文
posted @ 2016-02-29 10:30 __Neo 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.提示:题目要求通过一颗... 阅读全文
posted @ 2016-01-24 15:06 __Neo 阅读(429) 评论(0) 推荐(0) 编辑
摘要: 题目:Find the total area covered by tworectilinearrectangles in a2Dplane.Each rectangle is defined by its bottom left corner and top right corner as sho... 阅读全文
posted @ 2015-09-12 17:30 __Neo 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题目:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.提示:此题要求出n阶乘的结尾零的个数。因为当且仅当阶... 阅读全文
posted @ 2015-09-12 15:07 __Neo 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse a singly linked list.提示:此题不难,可以用迭代或者递归两种方法求解。记得要把原来的链表头的next置为NULL;代码:迭代:/** * Definition for singly-linked list. * struct ListNode { * ... 阅读全文
posted @ 2015-09-10 16:45 __Neo 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 题目:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: ... 阅读全文
posted @ 2015-09-10 11:55 __Neo 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), retu... 阅读全文
posted @ 2015-09-10 11:13 __Neo 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 题目:Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1 -1) { v1 = atoi(version1.substr(0, pos1).c_st... 阅读全文
posted @ 2015-09-09 19:53 __Neo 阅读(159) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 22 下一页