码迷,mamicode.com
首页 >  
搜索关键字:leecode    ( 178个结果
leecode 每日解题思路 102-Binary Tree Level Order Traversal
題目描述:题目链接:102-Binary Tree Level Order Traversal这个问题要解决的是如何逐层遍历一个二叉树,并把同一层元素放入同一list中, 再将所有元素返回。其实当时我的第一个反应就是树类型的题目已经做了好多了,无非用来用去就是递归,或者队列,那如何解决这个问题呢?先...
分类:其他好文   时间:2015-09-01 14:04:45    阅读次数:188
leecode Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr...
分类:其他好文   时间:2015-08-14 00:57:36    阅读次数:99
LeeCode 109.Convert Sorted List to Binary Search Tree(将排序链表转化为BST) 解题思路和方法
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 思路:此题与排序数组很大的不同是链表不知道长度以及上面的值。其整体思路还是中间值作为根节点,但是需要一点策略,不然就会超时。 先整体遍历长度之后,将长度保存,这样就不需要每...
分类:编程语言   时间:2015-08-05 15:00:53    阅读次数:146
LeeCode(Database)-Employees Earning More Than Their Managers
TheEmployeetable holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id.+----+-------+-...
分类:数据库   时间:2015-07-27 13:02:26    阅读次数:182
LeeCode(Database)-Duplicate Emails
Write a SQL query to find all duplicate emails in a table namedPerson.+----+---------+| Id | Email |+----+---------+| 1 | a@b.com || 2 | c@d.com |...
分类:数据库   时间:2015-07-27 12:57:27    阅读次数:142
LeeCode(Database)-Customers Who Never Order
Suppose that a website contains two tables, theCustomerstable and theOrderstable. Write a SQL query to find all customers who never order anything.Tab...
分类:数据库   时间:2015-07-27 12:48:29    阅读次数:249
LeeCode(Database)-Combine Two Tables
Table:Person+-------------+---------+| Column Name | Type |+-------------+---------+| PersonId | int || FirstName | varchar || LastName ...
分类:数据库   时间:2015-07-27 12:29:37    阅读次数:174
LeeCode-Remove Linked List Elements
Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --...
分类:其他好文   时间:2015-07-20 10:47:55    阅读次数:111
LeeCode-Sqrt(x)
Implementint sqrt(int x).Compute and return the square root ofx. 1 int mySqrt(int x) 2 { 3 if(x==1) 4 return 1; 5 6 /* for(int i=2;i<...
分类:其他好文   时间:2015-07-20 10:45:48    阅读次数:132
LeeCode-Pow(x, n)
Implement pow(x,n).1 double myPow(double x, int n) 2 {3 if(n==0) 4 return 1.0; 5 if(n<0) 6 return 1.0/pow(x,-n); 7 ret...
分类:其他好文   时间:2015-07-20 10:43:22    阅读次数:121
178条   上一页 1 ... 9 10 11 12 13 ... 18 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!