Merge k Sorted Lists
Merge k sorted
linked lists and return it as one sorted list. Analyze and describe its complexity.
解题思路:
1、分治方法,两两合并。设每个链表的长度为n,有k个链表,那么每次合并最多扫描所有的元素,共扫描k/2+k/4+...+1=k次...
分类:
其他好文 时间:
2015-04-22 15:13:58
阅读次数:
127
原图:效果1:效果2:
效果3:效果4:
查看官方的API,其中ColorMatrix的说明如下:
5x4 matrix for transforming the color+alpha components of a Bitmap. The matrix is stored in a single array, and its
treated as fo...
分类:
移动开发 时间:
2015-04-22 13:52:10
阅读次数:
267
1.正交向量、正交空间、正交补空间2.号称是本书最重要的配图3.向量的cosine距离,投影变换,最小二乘4.正交基与Schmidt正交化与QR分解5.函数空间,傅里叶级数,Hilbert空间
分类:
移动开发 时间:
2015-04-22 00:05:59
阅读次数:
136
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:
其他好文 时间:
2015-04-21 22:08:41
阅读次数:
165
problem:
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
Hide Tags
Tr...
分类:
其他好文 时间:
2015-04-21 11:20:10
阅读次数:
108
Don’t Just Learn the Language, Understand Its CultureAnders NoråsiN HiGH SCHOOL, i HAD TO LEARN A FOREiGN LANGUAGE. At the time, I thought that I’d get by nicely being good at English, so I chose to sl...
分类:
其他好文 时间:
2015-04-21 09:43:12
阅读次数:
128
problem:
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For exa...
分类:
其他好文 时间:
2015-04-21 09:37:25
阅读次数:
266
Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.
For example,
Given linked list: 1->2->3->4->5, and n = 2.
After remo...
分类:
其他好文 时间:
2015-04-20 21:00:30
阅读次数:
129
Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor...
分类:
其他好文 时间:
2015-04-20 16:38:34
阅读次数:
116
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:
其他好文 时间:
2015-04-20 14:44:04
阅读次数:
98