本文仅为博主个人总结,水平有限,欢迎大神指出不妥处。 关于二叉树的相关概念可以参见二叉树的百度百科,或binary tree Wiki。 二叉树结点类的常见定义为: 提 ...
本文仅为博主个人总结,水平有限,欢迎大神指出不妥处。 关于二叉树的相关概念可以参见二叉树的百度百科,或binary tree Wiki。 二叉树结点类的常见定义为: 提 ...
题目:输出1到1000之间的所有素数 质数(prime number)又称素数,有无限个。质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数,这样的数称为质数。 思路:偶数肯定不是素 ...
Given n non-negative integers representing the histogram's bar height where the width of each bar is ...
Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthes ...
Given a string S, find the longest palindromic substring in S. You may assume that the maximum lengt ...
Given a string, find the length of the longest substring without repeating characters. For example, ...
本文是个人对LeetCode中字符串类型题目的总结,纯属个人感悟,若有不妥的地方,欢迎指出。 一、有关数字 1、数转换 题Interger to roman和Roman to integer这两 ...
Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For exam ...
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...