08 2014 档案

摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?题目意... 阅读全文
posted @ 2014-08-29 11:53 birdhack 阅读(322) 评论(0) 推荐(0)
摘要:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?/** * Definition for singly-linked list. *... 阅读全文
posted @ 2014-08-28 18:01 birdhack 阅读(87) 评论(0) 推荐(0)
摘要:Given a singly linked listL: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 exam... 阅读全文
posted @ 2014-08-28 16:50 birdhack 阅读(116) 评论(0) 推荐(0)
摘要:Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1]. 1... 阅读全文
posted @ 2014-08-28 10:15 birdhack 阅读(111) 评论(0) 推荐(0)
摘要:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文
posted @ 2014-08-27 20:50 birdhack 阅读(155) 评论(0) 推荐(0)