Leaf-Similar Trees

作者:sryan 更新时间:2020-05-15 17:38 分类:数据结构与算法

Consider all the leaves of a binary tree. From left to right order, the values of those leaves form ...

点击数:492 回复数:0

Binary gap

作者:sryan 更新时间:2020-05-15 17:26 分类:数据结构与算法

Given a positive integer N, find and return the longest distance between two consecutive 1's in the ...

点击数:614 回复数:0

Transpose matrix

作者:sryan 更新时间:2020-05-15 17:12 分类:数据结构与算法

Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it...

点击数:512 回复数:0

Design hashset

作者:sryan 更新时间:2020-05-15 16:43 分类:数据结构与算法

Design a HashSet without using any built-in hash table libraries. To be specific, your design should...

点击数:546 回复数:0

Binary search

作者:sryan 更新时间:2020-05-15 16:23 分类:数据结构与算法

这题是基础题,但是细节挺多的,先上题目 Given a sorted (in ascending order) integer array nums of n elements and a targe...

点击数:496 回复数:0

Search in a binary search tree

作者:sryan 更新时间:2020-04-07 15:54 分类:数据结构与算法

这题没难度,首先看下题目: Given the root node of a binary search tree (BST) and a value. You need to find the no...

点击数:458 回复数:0

N-ary Tree Preorder Traversal

作者:sryan 更新时间:2020-04-07 15:40 分类:数据结构与算法

这题的数据结构还是上一题的,很简单,熟悉二叉树遍历的看一眼就写出来了。先看题目: Given an n-ary tree, return the preorder traversal of its n...

点击数:520 回复数:0

Maximum Depth of N-ary Tree

作者:sryan 更新时间:2020-04-07 15:31 分类:数据结构与算法

先看题目 Given a n-ary tree, find its maximum depth. The maximum depth is the number of nodes along the ...

点击数:517 回复数:0

Shortest Completing Word

作者:sryan 更新时间:2020-04-07 12:03 分类:数据结构与算法

这题没啥好说的,但是我理解题意理解了好久。。。 Find the minimum length word from a given dictionary words, which has all th...

点击数:497 回复数:0

To lower Case

作者:sryan 更新时间:2020-04-03 17:40 分类:数据结构与算法

这题不多说,不会做的闭门思过。 Implement function ToLowerCase() that has a string parameter str, and returns the sa...

点击数:566 回复数:0