摘要:
题目描述:将数组到零移到最后,并保持不为0到数相对位置不变 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-z 阅读全文
摘要:
题目描述:反转链表 Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 阅读全文
摘要:
题目描述:给一个二叉树,反转它 Invert a binary tree. Example: Input: Output: Trivia:This problem was inspired by this original tweet by Max Howell: 思路: 递归,从根节点出发,反转当 阅读全文
摘要:
题目描述: 给一个数组,数组中只有一个数字出现了一次,其他的数字都出现了两次,找到这个只出现一次的数字 Given a non-empty array of integers, every element appears twice except for one. Find that single 阅读全文
摘要:
题目描述:给一个二叉树,返回该二叉树的最大深度 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root nod 阅读全文
摘要:
题目描述:给予两个二叉树 t1 , t2 ,合并他们。 Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overl 阅读全文