会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
xpp
CnBlogs
Home
New Post
Contact
Admin
Subscription
上一页
1
···
3
4
5
6
7
8
9
10
11
下一页
2017年3月31日
Sort List
思路:使用归并排序的方法,注意寻找的中间节点位置
Read More
posted @ 2017-03-31 09:06 chengcy
Views(140)
Comments(0)
Diggs(0)
2017年3月30日
Search Insert Position
思路:注意特殊情况的处理,如[1]:0,[1]:2
Read More
posted @ 2017-03-30 22:16 chengcy
Views(112)
Comments(0)
Diggs(0)
Insertion Sort List
思路:这里新建一个list方便插入排序
Read More
posted @ 2017-03-30 21:56 chengcy
Views(107)
Comments(0)
Diggs(0)
2017年3月28日
Merge Two Sorted Lists
思路:直接判断连接即可
Read More
posted @ 2017-03-28 19:07 chengcy
Views(108)
Comments(0)
Diggs(0)
Merge Sorted Array
思路:当从前遍历nums1时每一次需要移动数组下标后所有元素,但是直接从后向前遍历则可以避免这种情况,这里需要注意nums1是空的情况
Read More
posted @ 2017-03-28 18:57 chengcy
Views(85)
Comments(0)
Diggs(0)
2017年3月25日
Linked List Cycle II
思路一:直接使用hashTable 思路二:http://bookshadow.com/weblog/2015/07/10/leetcode-linked-list-cycle-ii/
Read More
posted @ 2017-03-25 13:11 chengcy
Views(112)
Comments(0)
Diggs(0)
Reorder List
思路:对列表后半部分逆序排列,然后连接。其中还是需要注意head = cur;cur = cur->next;head->next = tmpNode;相对位置。
Read More
posted @ 2017-03-25 12:24 chengcy
Views(114)
Comments(0)
Diggs(0)
2017年3月24日
Linked List Cycle
思路一:之间使用hashTable进行判断 思路二:使用两个指针,一个步幅,一个小,若最终相遇则存在cycle
Read More
posted @ 2017-03-24 18:41 chengcy
Views(115)
Comments(0)
Diggs(0)
2017年3月20日
Copy List with Random Pointer
思路一:使用一个hashTable存储原List到新List的映射,其中tmpNode->random = head->random;记录random映射,不错这里tmpNode是新List中的结点,head是原List中的结点,经过两个映射(指向原List中的结点,映射至对应的新List)即可完成
Read More
posted @ 2017-03-20 09:52 chengcy
Views(125)
Comments(0)
Diggs(0)
2017年3月18日
Swap Nodes in Pairs
思路一:记录遍历列表过程中奇偶性,然后进行交换 思路二:上面思路中使用两个指针,但实际使用三个指针会方便很多
Read More
posted @ 2017-03-18 22:22 chengcy
Views(133)
Comments(0)
Diggs(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
下一页
公告