一、原题 Given preorder and inorder traversal of a tree, construct the binary tree.  Note:  You may assume that duplicates do not exist in the tree.  一、中文 一种是根据前序和中序来构建二叉树,一种是根据中序和后序来构建二叉树 三、举例 (1)给出先序遍历的

LeetCode   二叉树   遍历  

一、原题 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 depth of the two subtrees of every node never di

LeetCode   java   二叉树  

一、原题   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 leaf node.  一、中文 给定一棵两叉树求树的最小深度。  三、举例 也就

二叉树   LeetCode  

一、原题 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,9,20,#,#,15,7}, 3 / \ 9 20 / \ 15 7 1

遍历   LeetCode   java  

一、原题   Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).    For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 1 2 3 4 5

LeetCode   二叉树  

一、原题 Given a binary tree, return the inorder traversal of its nodes values.  一、中文 二叉树的前序、中序、后序三种遍历方式的总结 三、举例 前序:根-左-右 中序:左-根-右 后序:左-右-根 四、思路   每一种遍历方式都有两种方式,一种是递归,一种是非递归的方式,递归很简单,下面主要是非递归的方式 (1)前序 首先建

LeetCode   java  

一、原题 Reverse a linked list from position m to n. Do it in-place and in one-pass.  For example:  Given 1->2->3->4->5->NULL, m = 2 and n = 4,  return 1->4->3->2->5->NULL.  二、中文 给定一个单链表,将第m到第n个之间的元素进行转 

LeetCode   单链表   java  

一、原题 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 original relative order of the nodes in each

LeetCode   java   单链表   分区  

一、原题   Given a 2D board and a word, find if the word exists in the grid.    The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or ver

LeetCode   java   单词搜索   递归   回溯  

一、原题 Given a sorted linked list, delete all duplicates such that each element appear only once.  For example,  Given 1->1->2, return 1->2.  Given 1->1->2->3->3, return 1->2->3.  一、中文 给定一个单链表,删除重复的元素,相

LeetCode   java   单链表   重复元素  
1 2 3 4