摘要: Given a binary tree, find its minimum depth. 阅读全文
posted @ 2014-07-02 23:58 jdflyfly 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is height-balanced. 阅读全文
posted @ 2014-07-02 23:55 jdflyfly 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. 阅读全文
posted @ 2014-07-02 23:48 jdflyfly 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 阅读全文
posted @ 2014-07-02 23:40 jdflyfly 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). 阅读全文
posted @ 2014-07-02 23:37 jdflyfly 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. 阅读全文
posted @ 2014-07-02 23:33 jdflyfly 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given inorder and postorder traversal of a tree, construct the binary tree. 阅读全文
posted @ 2014-07-02 23:05 jdflyfly 阅读(195) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its maximum depth. 阅读全文
posted @ 2014-07-02 23:02 jdflyfly 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 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 alternate between). 阅读全文
posted @ 2014-07-02 23:00 jdflyfly 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). 阅读全文
posted @ 2014-07-02 22:54 jdflyfly 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). 阅读全文
posted @ 2014-07-02 22:46 jdflyfly 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not. 阅读全文
posted @ 2014-07-02 22:43 jdflyfly 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Two elements of a binary search tree (BST) are swapped by mistake. 阅读全文
posted @ 2014-07-02 22:36 jdflyfly 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is a valid binary search tree (BST). 阅读全文
posted @ 2014-07-02 22:26 jdflyfly 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. 阅读全文
posted @ 2014-07-02 22:21 jdflyfly 阅读(172) 评论(1) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. 阅读全文
posted @ 2014-07-02 00:28 jdflyfly 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. 阅读全文
posted @ 2014-07-02 00:11 jdflyfly 阅读(258) 评论(1) 推荐(0) 编辑
摘要: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? 阅读全文
posted @ 2014-07-02 00:05 jdflyfly 阅读(127) 评论(0) 推荐(0) 编辑