上一页 1 ··· 59 60 61 62 63 64 65 66 67 ··· 76 下一页
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2019-08-29 01:40 Schwifty 阅读(125) 评论(0) 推荐(0)
摘要: Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 /** * Definition for a binary tree node. * public cl 阅读全文
posted @ 2019-08-28 09:53 Schwifty 阅读(118) 评论(0) 推荐(0)
摘要: Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 阅读全文
posted @ 2019-08-28 02:10 Schwifty 阅读(134) 评论(0) 推荐(0)
摘要: Given a binary tree, return the postorder traversal of its nodes' values. Example: LinkedList有addFirst方法,巧妙。 阅读全文
posted @ 2019-08-28 01:12 Schwifty 阅读(135) 评论(0) 推荐(0)
摘要: Given a binary tree, return the preorder traversal of its nodes' values. Example: 阅读全文
posted @ 2019-08-27 11:26 Schwifty 阅读(138) 评论(0) 推荐(0)
摘要: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文
posted @ 2019-08-27 10:13 Schwifty 阅读(115) 评论(0) 推荐(0)
摘要: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2019-08-27 02:02 Schwifty 阅读(118) 评论(0) 推荐(0)
摘要: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Exampl 阅读全文
posted @ 2019-08-25 08:34 Schwifty 阅读(110) 评论(0) 推荐(0)
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: No 阅读全文
posted @ 2019-08-25 05:48 Schwifty 阅读(132) 评论(0) 推荐(0)
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2019-08-25 02:07 Schwifty 阅读(172) 评论(0) 推荐(0)
上一页 1 ··· 59 60 61 62 63 64 65 66 67 ··· 76 下一页