摘要: Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime comp... 阅读全文
posted @ 2014-06-27 23:21 穆穆兔兔 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity... 阅读全文
posted @ 2014-06-27 22:45 穆穆兔兔 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.方法:在inorder中寻找... 阅读全文
posted @ 2014-06-27 22:40 穆穆兔兔 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.方法一:最先想到的就是递归,注... 阅读全文
posted @ 2014-06-27 17:53 穆穆兔兔 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l... 阅读全文
posted @ 2014-06-27 14:03 穆穆兔兔 阅读(234) 评论(0) 推荐(0) 编辑