10 2020 档案

摘要:Given an n-ary tree, return the level order traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversa 阅读全文
posted @ 2020-10-31 12:49 little_veggie 阅读(63) 评论(0) 推荐(0)
摘要:Given the root of a binary tree with N nodes, each node in the tree has node.val coins, and there are N coins total. In one move, we may choose two ad 阅读全文
posted @ 2020-10-29 14:56 little_veggie 阅读(66) 评论(0) 推荐(0)
摘要: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 阅读(121) 评论(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 阅读(83) 评论(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 阅读(106) 评论(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 阅读(99) 评论(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 阅读(87) 评论(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 阅读(80) 评论(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 阅读(81) 评论(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 阅读(144) 评论(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 阅读(87) 评论(0) 推荐(0)
摘要:Design your implementation of the linked list. You can choose to use a singly or doubly linked list.A node in a singly linked list should have two att 阅读全文
posted @ 2020-10-25 12:54 little_veggie 阅读(161) 评论(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 @ 2020-10-25 11:55 little_veggie 阅读(71) 评论(0) 推荐(0)
摘要:Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initia 阅读全文
posted @ 2020-10-10 14:15 little_veggie 阅读(110) 评论(0) 推荐(0)
摘要:Given a collection of intervals, merge all overlapping intervals. Example 1: Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15 阅读全文
posted @ 2020-10-04 03:38 little_veggie 阅读(126) 评论(0) 推荐(0)
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, 阅读全文
posted @ 2020-10-03 14:07 little_veggie 阅读(135) 评论(0) 推荐(0)
摘要:Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com 阅读全文
posted @ 2020-10-03 11:49 little_veggie 阅读(107) 评论(0) 推荐(0)
摘要:Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] (si < ei), find the minimum number of conference room 阅读全文
posted @ 2020-10-03 06:31 little_veggie 阅读(133) 评论(0) 推荐(0)