摘要: Given a binary tree struct Node { int val; Node *left; Node *right; Node *next; } Populate each next pointer to point to its next right node. If there 阅读全文
posted @ 2020-10-28 14:40 little_veggie 阅读(113) 评论(0) 推荐(0)
摘要: You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the following defin 阅读全文
posted @ 2020-10-28 14:09 little_veggie 阅读(116) 评论(0) 推荐(0)
摘要: Given an m x n matrix. If an element is 0, set its entire row and column to 0. Do it in-place. Follow up: A straight forward solution using O(mn) spac 阅读全文
posted @ 2020-10-28 13:20 little_veggie 阅读(77) 评论(0) 推荐(0)
摘要: Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree. You may assume each number in the seq 阅读全文
posted @ 2020-10-28 12:50 little_veggie 阅读(103) 评论(0) 推荐(0)
摘要: Design a HashMap without using any built-in hash table libraries. To be specific, your design should include these functions: put(key, value) : Insert 阅读全文
posted @ 2020-10-28 08:45 little_veggie 阅读(96) 评论(0) 推荐(0)
摘要: Create a timebased key-value store class TimeMap, that supports two operations. 1. set(string key, string value, int timestamp) Stores the key and val 阅读全文
posted @ 2020-10-27 15:14 little_veggie 阅读(81) 评论(0) 推荐(0)
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2020-10-27 14:42 little_veggie 阅读(76) 评论(0) 推荐(0)
摘要: The set [1,2,3,...,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, we get the following seque 阅读全文
posted @ 2020-10-27 13:46 little_veggie 阅读(77) 评论(0) 推荐(0)
摘要: Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the sam 阅读全文
posted @ 2020-10-26 14:05 little_veggie 阅读(139) 评论(0) 推荐(0)
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2020-10-26 12:58 little_veggie 阅读(83) 评论(0) 推荐(0)