Count Complete Tree Nodes Given a complete binary tree, count the number of nodes. Definition of a complete bi…
分类:LeetCode
[Leetcode] Unique Binary Search Trees 唯一二叉搜索树
Unique Binary Search Trees I && II 解法请见:https://yanjia.li/zh/2019/02/… Given n, how many structu…
same-tree
描述: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considere…
Leetcode 126. Word Ladder II
Given two words (beginWord and endWord), and a dictionary’s word list, find all shortest transformation …
LeetCode刷题之Remove Element
Problem Do not allocate extra space for another array, you must do this in place with constant memory. The ord…
[LeetCode By Go 83]101. Symmetric Tree
题目 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example,…
leetcode-7. Reverse Integer
题目 Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 思路分析: Have you …
LeetCode | Anagrams
题目: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in low…
力扣(LeetCode)652
题目地址:https://leetcode-cn.com/probl…题目描述:给定一棵二叉树,返回所有重复的子树。对于同一类的重复子树,你只需要返回其中任意一棵的根结点即可。 两棵树重复是指它们具有相同的结…
LeetCode | Search a 2D Matrix(二维矩阵中查找)
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has…
26. 删除排序数组中的重复项(Swift版)
一、题目 定一个排序数组,你需要在原地删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。 不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成。 示例 1: 给定数组…
[LeetCode] Preimage Size of Factorial Zeroes Function 阶乘零的原像个数函数
Let f(x) be the number of zeroes at the end of x!. (Recall that x! = 1 * 2 * 3 * ..…