上一页 1 2 3 4 5 6 ··· 22 下一页
摘要: Question Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in whic 阅读全文
posted @ 2019-08-18 04:55 树獭君 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Recursion is a technique in which a problem is solved by itself; it's a technique to solve most Divide & Conquer problems. Differences between Divide 阅读全文
posted @ 2019-08-18 04:20 树獭君 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Question Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the following rules: Example: Follow up:Could yo 阅读全文
posted @ 2016-11-02 12:22 树獭君 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Question Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. w 阅读全文
posted @ 2016-11-01 10:41 树獭君 阅读(244) 评论(0) 推荐(0) 编辑
摘要: Question Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. For example, g 阅读全文
posted @ 2016-11-01 05:14 树獭君 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Question Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation coul 阅读全文
posted @ 2016-11-01 00:19 树獭君 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Question Given an integer array, find a subarray with sum closest to zero. Return the indexes of the first number and last number. Given [-3, 1, 1, -3 阅读全文
posted @ 2016-10-25 01:19 树獭君 阅读(465) 评论(0) 推荐(0) 编辑
摘要: Question Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You m 阅读全文
posted @ 2016-10-23 04:12 树獭君 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Question Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) 阅读全文
posted @ 2016-10-20 12:49 树獭君 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 从BST中移除一个节点是比较复杂的问题,需要分好几种情况讨论。 如这篇文章,就讨论了删除节点 1.有无左右子树 2.只有右子树 3.只有左子树 三种情况。 一种简单些的思维是只考虑删除节点是否有右子树(因为第一个比删除节点大的节点可能出现在右子树,不会出现在左子树)。 这里用Target表示删除节点 阅读全文
posted @ 2016-10-18 11:03 树獭君 阅读(150) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 22 下一页