We are given a linked list with head as the first node. ...[作者空间]
Given an array A of 0s and 1s, consider N_i: the i-th sub...[作者空间]
Given a positive integer K, you need find the smallest po...[作者空间]
Given an array A of positive integers, A[i] represents th...[作者空间]
Given a number N, return a string consisting of "0"s and ...[作者空间]
Given an array A of integers, return true if and only if ...[作者空间]
A conveyor belt has packages that must be shipped from on...[作者空间]
In a list of songs, the i-th song has a duration of time[...[作者空间]
Every non-negative integer N has a binary representation....[作者空间]
Return the root node of a binary search tree that matches...[作者空间]
In a row of dominoes, A[i] and B[i] represent the top and...[作者空间]
Normally, the factorial of a positive integer n is the pr...[作者空间]
Given an array A of integers, we must modify the array in...[作者空间]
Given a binary string S (a string consisting only of '0' ...[作者空间]
实现一种猫狗队列的结构,要求如下: 用户可以调用add方法将cat类或者dog类的实例放入队列中; 用户可以调用p...[作者空间]
一个栈依次压入1、2、3、4、5,那么从栈顶到栈底分别是5、4、3、2、1。要求只用递归,不借助其他数据结构,实现...[作者空间]
编写一个类,用两个栈实现队列,支持队列的基本操作(add、poll、peek)。 解题思路 为了实现栈后进先出的特...[作者空间]
实现一个特殊的栈,在实现栈的基本功能的基础上,再实现返回栈中最小元素的操作。 解题思路 使用两个栈来实现,其中一个...[作者空间]