"105-construct binary tree from preorder and inorder traversal (construction of two-fork trees via pre-order and middle-order traversal)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven Preorder and inorder traversal of a tree, construct the binary tree. Note:Assume that duplicates does not exist in th
"203-remove Linked list Elements (remove elements from single-linked list)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"code Download "Https://github.com/Wang-Jun-Chao"Original QuestionRemove all elements from a linked list of integers, that has value Val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6 , val = 6Return
"027-remove element (removes elements from an array)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn ' t matter what are you leave beyond the new length.Main TopicG
"025-reverse Nodes in K-group (a set of K nodes in a single linked list is reversed)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven A linked list, reverse the nodes of a linked list K at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end sh
"061-rotate list (revolving single linked list)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a list, rotate the list to the right by K-places, where K is non-negative.For example:Given 1->2->3->4->5->NULL k = 2 and,Return 4->5->1->2->3->NULL .Main TopicRotate a single linked list to the right, rotat
"113-path Sum II (Path and II)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a binary tree and a sum, find all root-to-leaf paths where each path ' s sum equals the Given sum.For example:Given the below binary tree and sum = 22, 5 4 8 / 11
"102-binary Tree Level Order traversal (binary tree sequence traversal)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven 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,9,20,#,#,15,7}, 3 9 20 /
"104-maximum Depth of binary tree (maximum depth of binary trees)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along, the longest path from the root node to the farthest leaf node.Main TopicGiven a two-pronged tree, ask f
"101-symmetric tree (symmetric trees)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a binary tree, check whether it is a mirror of the itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 2 \ 3 4 4 3But the following are not: 1 2 2 \ 3 3
"111-minimum Depth of Binary tree (minimum depth of binary trees)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along, the shortest path from the root node to the nearest leaf node.Main TopicGiven a two-fork tree to find t
"107-binary Tree Level Order Traversal II (binary tree Sequence Traversal II)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a binary tree, return the bottom-up level order traversal of its nodes ' values. (ie, from the left-to-right, the level by level from the leaf to root).For example:Given binary
"108-convert Sorted array to binary Search tree (sort array into balanced binary tree)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven an array where elements is sorted in ascending order, convert it to a height balanced BST.Main TopicGiven an ascending two-prong tree, convert it to a highly balanced t
"083-remove duplicates from Sorted list (to remove duplicate nodes in a sorted single-linked list)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven a sorted linked list, delete all duplicates such this each element appear only once.For example,Given 1->1->2 , return 1->2 .Given 1->1->2->3->3 , return 1-
"098-validate binary search Tree""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven 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 nodes with keys less than the node ' s key.The right subtree of a node contains
"119-pascal ' s Triangle II (Pascal triangle (Yang Hui triangle) II)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionGiven an index k, return the kth row of the Pascal ' s triangle.For example, given k = 3,Return [1,3,3,1] . Note:Could optimize your algorithm to
"023-merge K Sorted Lists (combined with k-lined single-linked list)""leetcode-Interview algorithm classic-java Implementation" "All topics Directory Index"Original QuestionMerge K sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Main TopicCombine k rows of single linked lists. Analyze and describe its complexity.Thinking
"101-symmetric tree (symmetric trees)""leetcode-Interview algorithm classic-java Implementation" "All Topics folder Index"Original QuestionGiven a binary tree, check whether it is a mirror of the itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 2 \ 3 4 4 3But the following are not: 1 2 2 \ 3 3Not
"106-construct binary tree from Inorder and postorder traversal (construct two-fork trees via middle order and post-sequence traversal)""leetcode-Interview algorithm classic-java Implementation" "All Topics folder Index"Original QuestionGiven Inorder and Postorder traversal of a tree, construct the binary tree. Note:Assume that duplicates does not exist in the t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.