摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy ... 阅读全文
posted @ 2014-09-01 22:51 birdhack 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(306) 评论(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 阅读(84) 评论(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 阅读(109) 评论(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 阅读(102) 评论(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 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 最近要做一个APP使用到文件选择,碰到4.4.2版本的手机就会出错,原来发现4.4获取资源路径已经改过了。 关于Android4.4的图片路径获取,如果回来的Uri的格式有两种: Version 4.4.2 出现之前,Intent.ACTION_GET_CONTENT打开相册会返回如下形式的U... 阅读全文
posted @ 2014-07-14 16:57 birdhack 阅读(3078) 评论(0) 推荐(0) 编辑
摘要: 1.ActionBar可以现实选项卡供用户切换浏览该Activity中不同的Fragment注:添加导航选项标签,必须给调用ActionBar的setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);2.每个标签都可以是一个图标或文本标题要使用选项标签在F... 阅读全文
posted @ 2014-07-13 15:37 birdhack 阅读(2507) 评论(0) 推荐(0) 编辑
摘要: 打开应用,判断是否第一次使用。 1 private void beforeInitMenu() { 2 AppContext appContext = (AppContext) getApplicationContext(); 3 4 if (appCon... 阅读全文
posted @ 2014-05-30 14:21 birdhack 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Animations的分类:Animations从总体来说可以分为两大类:第一类:Tweened Animations。渐变动画。该类Animations提供了旋转,移动,伸展和淡出等等效果。第二类:Frame-by-Frame Animations。这一类Animations可以创建一个Drawa... 阅读全文
posted @ 2014-05-30 13:40 birdhack 阅读(194) 评论(0) 推荐(0) 编辑