2016年2月25日

Construct Binary Tree from Preorder and Inorder Traversal

摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. Subscribe to 阅读全文

posted @ 2016-02-25 15:31 walkwalkwalk 阅读(150) 评论(0) 推荐(0) 编辑

Convert Sorted Array to Binary Search Tree

摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. Subscribe to see which companies asked this question 阅读全文

posted @ 2016-02-25 10:47 walkwalkwalk 阅读(105) 评论(0) 推荐(0) 编辑

Invert Binary Tree

摘要: Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia:This problem was inspired by this original tweet by Max Howell: Go 阅读全文

posted @ 2016-02-25 10:41 walkwalkwalk 阅读(146) 评论(0) 推荐(0) 编辑

导航