11 2016 档案

103. Binary Tree Zigzag Level Order Traversal (Tree, Queue; BFS)
摘要:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and 阅读全文

posted @ 2016-11-15 21:54 joannae 阅读(207) 评论(0) 推荐(0)

102. Binary Tree Level Order Traversal (Tree, Queue; BFS)
摘要:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3, 阅读全文

posted @ 2016-11-15 21:46 joannae 阅读(218) 评论(0) 推荐(0)

100. Same Tree (Tree;DFS)
摘要:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an 阅读全文

posted @ 2016-11-14 22:37 joannae 阅读(262) 评论(0) 推荐(0)

98. Validate Binary Search Tree (Tree; DFS)
摘要:Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文

posted @ 2016-11-14 20:39 joannae 阅读(276) 评论(0) 推荐(0)

94. Binary Tree Inorder Traversal(Tree, stack)
摘要:Given a binary tree, return the inorder traversal of its nodes' values.For example:Given binary tree [1,null,2,3], 1 \ 2 / 3return [1,3,2].Note: Recur 阅读全文

posted @ 2016-11-13 07:09 joannae 阅读(245) 评论(0) 推荐(0)

81. Search in Rotated Sorted Array II (Array; Divide-and-Conquer)
摘要: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 function 阅读全文

posted @ 2016-11-11 21:11 joannae 阅读(255) 评论(0) 推荐(0)

68. Text Justification
摘要:Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.You shoul 阅读全文

posted @ 2016-11-02 20:38 joannae 阅读(174) 评论(0) 推荐(0)

导航