05 2019 档案
摘要:Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we use
阅读全文
摘要:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequ
阅读全文
摘要:There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following re
阅读全文
摘要:Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note: Your al
阅读全文
摘要:There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs
阅读全文
摘要:Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti
阅读全文
摘要:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path1->2->3 which
阅读全文
摘要:Given an unsorted array of integers, find the length of the longest consecutive elements sequence. Your algorithm should run in O(n) complexity. Examp
阅读全文
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord,
阅读全文
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, w
阅读全文
摘要:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction
阅读全文
摘要:Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: The flattened tree should look like:
阅读全文
摘要:Given a string S and a string T, count the number of distinct subsequences of S which equals T。A subsequence of a string is a new string which is form
阅读全文
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. N
阅读全文
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is de
阅读全文
摘要:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le
阅读全文
摘要: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 which the dep
阅读全文
摘要:Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example,
阅读全文
摘要:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and
阅读全文
摘要:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3
阅读全文
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet
阅读全文
摘要:Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identi
阅读全文
摘要:并发 在Go语言中较为出名的就是他本身支持高并发机制,通过在程序中使用关键字go 函数名() 来创建一个并发任务单元,然后系统将任务单元放置在系统队列中,等待调度器安排合适系统线程去获取执行权并执行任务单元(就是函数)。在这其中每个任务单元保存了该函数的指针、传入的参数、执行所需的栈内空间大小(2K
阅读全文
摘要: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 contains only
阅读全文
摘要:Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? Example:
阅读全文
摘要:Given a binary tree, return the inorder traversal of its nodes' values. Example: Follow up: Recursive solution is trivial, could you do it iteratively
阅读全文
摘要:Reverse a linked list from position m to n. Do it in one-pass. Note: 1 ≤ m ≤ n ≤ length of list. Example:
阅读全文
摘要:Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta
阅读全文
摘要:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the o
阅读全文
摘要:在Go语言中没有了class 类关键字,但是这并不代表Go语言不能使用面向对象编程,在Go语言中使用了struct关键和interface 关键字来定义对象和方法接口。具体如下: 面向对象 Go中使用struct来定义类,假如我们需要定义一个person类,其中包含姓名、年龄等信息。我们可以使用st
阅读全文
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example:
阅读全文
摘要:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinctnumbers from the original list. Example 1: Example 2:
阅读全文
摘要:Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2:
阅读全文
浙公网安备 33010602011771号