摘要: 1.用两个栈实现队列 "232.Implement Queue using Stacks" Implement the following operations of a queue using stacks. push(x) Push element x to the back of queue. 阅读全文
posted @ 2016-11-20 18:25 BinWone 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 使用MathJax引擎 输入: 显示:$$x=\frac{ b\pm\sqrt{b^2 4ac}}{2a}$$ 参考资料: 1. "MathJax basic tutorial and quick reference" 2. "Mathjax与LaTex公式简介" 3. "markdown语法之如何 阅读全文
posted @ 2016-11-17 15:13 BinWone 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 已知先序遍历和中序遍历及已知中序遍历和后序遍历重建二叉树的Python递归和迭代解法 105. Construct Binary Tree from Preorder and Inorder Traversal https://leetcode.com/problems/construct bina 阅读全文
posted @ 2016-11-15 22:13 BinWone 阅读(850) 评论(0) 推荐(0) 编辑
摘要: 112. Path Sum https://leetcode.com/problems/path sum/ Given a binary tree and a sum, determine if the tree has a root to leaf path such that adding up 阅读全文
posted @ 2016-11-12 10:43 BinWone 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 96. Unique Binary Search Trees https://leetcode.com/problems/unique binary search trees/ Given n, how many structurally unique BST's (binary search tr 阅读全文
posted @ 2016-11-11 22:16 BinWone 阅读(140) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/kth smallest element in a bst/ Given a binary search tree, write a function kthSmallest to find the kth smallest element 阅读全文
posted @ 2016-11-10 21:20 BinWone 阅读(124) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/validate binary search tree/ Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is d 阅读全文
posted @ 2016-11-10 21:16 BinWone 阅读(110) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/delete node in a bst/ Given a root node reference of a BST and a key, delete the node with the given key in the BST. Ret 阅读全文
posted @ 2016-11-10 20:27 BinWone 阅读(667) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/convert sorted array to binary search tree/ Given an array where elements are sorted in ascending order, convert it to a 阅读全文
posted @ 2016-11-10 19:53 BinWone 阅读(126) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/sum root to leaf numbers/ Given a binary tree containing digits from 0 9 only, each root to leaf path could represent a 阅读全文
posted @ 2016-11-10 16:27 BinWone 阅读(140) 评论(0) 推荐(0) 编辑