上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页
摘要: Problem : Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given bin 阅读全文
posted @ 2020-02-17 22:01 littledy 阅读(82) 评论(0) 推荐(0)
摘要: Problem : 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 con 阅读全文
posted @ 2020-02-17 21:14 littledy 阅读(96) 评论(0) 推荐(0)
摘要: Problem : Given an integer n , generate all structurally unique BST's (binary search trees) that store values 1 ... n . Example: 思路 : 同样采用递归的思想。若节点$i$ 阅读全文
posted @ 2020-02-17 10:13 littledy 阅读(90) 评论(0) 推荐(0)
摘要: Problem : Given n , how many structurally unique BST 's (binary search trees) that store values 1 ... n ? Example: 思路 : 二叉搜索树(Binary Search Tree, BST) 阅读全文
posted @ 2020-02-16 11:43 littledy 阅读(85) 评论(0) 推荐(0)
摘要: Problem : Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it i 阅读全文
posted @ 2020-02-16 10:47 littledy 阅读(116) 评论(0) 推荐(0)
摘要: Problem : Given n non negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle i 阅读全文
posted @ 2020-02-16 10:17 littledy 阅读(85) 评论(0) 推荐(0)
摘要: Problem : Reverse a linked list from position m to n . Do it in one pass. Note: 1 ≤ m ≤ n ≤ length of list. Example: 思路 : 保存2个节点 和`cur pre cur cur nex 阅读全文
posted @ 2020-02-15 23:31 littledy 阅读(97) 评论(0) 推荐(0)
摘要: Problem : 思路 : Solution (C++) : 性能 : Runtime: 20 ms Memory Usage: 19.9 MB 阅读全文
posted @ 2020-02-12 20:56 littledy 阅读(78) 评论(0) 推荐(0)
摘要: Problem : 思路 : Solution (C++) : 性能 : Runtime: 8 ms Memory Usage: 19.9 MB 阅读全文
posted @ 2020-02-12 19:55 littledy 阅读(86) 评论(0) 推荐(0)
摘要: Problem : 思路 : Solution (C++) : 性能 : Runtime: 8 ms Memory Usage: 9.1 MB 阅读全文
posted @ 2020-02-12 19:42 littledy 阅读(101) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 23 下一页