摘要: Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.想法很简单,就是两两合并。在Merge Two Sorted Lists这道题已经实现了两两合并的代码了,就... 阅读全文
posted @ 2014-05-02 21:33 linyx 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which... 阅读全文
posted @ 2014-05-02 21:11 linyx 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded ... 阅读全文
posted @ 2014-05-02 20:47 linyx 阅读(259) 评论(0) 推荐(0) 编辑
摘要: Log scale 1 %# some random data 2 x = 2.^(0:10); 3 y = rand(size(x)); 4 5 plot(log2(x), y) %# plot on log2 x-scale 6 se... 阅读全文
posted @ 2014-05-02 15:24 linyx 阅读(290) 评论(0) 推荐(0) 编辑
摘要: Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a pla... 阅读全文
posted @ 2014-05-02 15:18 linyx 阅读(265) 评论(0) 推荐(0) 编辑