2016年5月10日

摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single 阅读全文
posted @ 2016-05-10 22:10 烁宝宝 阅读(126) 评论(0) 推荐(0)
 
摘要: Given an array of integers, every element appears three times except for one. Find that single one. 代码如下: 阅读全文
posted @ 2016-05-10 18:41 烁宝宝 阅读(137) 评论(0) 推荐(0)
 
摘要: Given an array of integers, every element appears twice except for one. Find that single one. 代码如下: 阅读全文
posted @ 2016-05-10 18:37 烁宝宝 阅读(143) 评论(0) 推荐(0)
 
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. 代码如下: 阅读全文
posted @ 2016-05-10 15:41 烁宝宝 阅读(129) 评论(0) 推荐(0)
 
摘要: Given a linked list, determine if it has a cycle in it. 代码如下: 阅读全文
posted @ 2016-05-10 15:36 烁宝宝 阅读(140) 评论(0) 推荐(0)
 
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2016-05-10 15:28 烁宝宝 阅读(148) 评论(0) 推荐(0)
 
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. 代码如下: 阅读全文
posted @ 2016-05-10 09:56 烁宝宝 阅读(113) 评论(0) 推荐(0)
 
摘要: Sort a linked list using insertion sort. 代码如下: 阅读全文
posted @ 2016-05-10 09:42 烁宝宝 阅读(104) 评论(0) 推荐(0)