2016年8月21日

Search a 2D Matrix

摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文

posted @ 2016-08-21 22:25 Sheryl Wang 阅读(110) 评论(0) 推荐(0) 编辑

Binary Postorder Traversal

摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [3,2,1]. 后续遍历二叉树,主要是使用栈来非递归实 阅读全文

posted @ 2016-08-21 17:14 Sheryl Wang 阅读(124) 评论(0) 推荐(0) 编辑

Search in Rotated Sorted Array II

摘要: Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a functi 阅读全文

posted @ 2016-08-21 12:12 Sheryl Wang 阅读(146) 评论(0) 推荐(0) 编辑

导航