版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/28/2013-11-28-CODE 146 Max Points on a Line/
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
|
|
戒急用忍
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/28/2013-11-28-CODE 146 Max Points on a Line/
Given n points
on a 2D plane, find the maximum number of points that lie on the same straight line.
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/27/2013-11-27-CODE 144 Insertion Sort List/
###
Sort a linked list using insertion sort.
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/26/2013-11-26-CODE 145 Sort List/
访问原文「CODE 145. Sort List」
Sort a linked list in O(n log n)
time using constant space complexity.
|
|
最近新做了一个模板的LOGO,为了让其更具美观和平滑型因此需要把图片角部修改为圆角,PS新手不防学习一下。
1.打开PhotoShop,并找开要处理的图片;
在写有”注意”字样的地方,这个按钮表示用此工具建立路径,
路径的作用也就是为了我们 [ 3.转换成选区(快捷键:Ctrl+Enter) ] ;
4.快捷键:ctrl+shift+I 作用是:反相选取区域,如图:
5.这时按键盘上的”DEL”键,将图片周边的删去;
6.Ctrl+D取消选区;
7.保存时可保存成:.GIF或.PNG这两种格式都可保存成透明的
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/26/2013-11-26-CODE 143LRU Cache/
访问原文「CODE 143. LRU Cache」
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get
and set
.get(key)
- Get the value (will always be positive) of the key if the
key exists in the cache, otherwise return -1.set(key, value)
- Set or insert the value if the key is not already
present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/25/2013-11-25-CODE 142 Binary Tree Postorder Traversal/
Given a binary tree, return the postorder traversal of its nodes’ values.
For example:
Given binary tree {1,#,2,3}
,
1
\
2
/
3
return [3,2,1]
.
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/25/2013-11-25-CODE 141 Binary Tree Preorder Traversal/
Given a binary tree, return the preorder traversal of its nodes’ values.
For example:
Given binary tree {1,#,2,3}
,
1
\
2
/
3
return [1,2,3]
.
Note: Recursive solution is trivial, could you do it iteratively?
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/25/2013-11-25-CODE 140 Reorder List/
访问原文「CODE 140. Reorder List」
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 example,
Given {1,2,3,4}
, reorder it to {1,4,2,3}
.
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/24/2013-11-24-CODE 139 Linked List Cycle II/
Given a linked list, return the node where the cycle begins. If there is no cycle, return null
.
Follow up:
Can you solve it without using extra space?
点击打开链接
|
|
版权声明:本文为博主原创文章,转载请注明出处:http://blog.jerkybible.com/2013/11/24/2013-11-24-CODE 138 Linked List Cycle/
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
|
|