摘要: LeetCode地址:https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ 题目描述: 给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 说明: 叶子节点是指没有子节点的节点。 示例:给 阅读全文
posted @ 2019-05-25 13:14 夏落若的博客 阅读(178) 评论(0) 推荐(0) 编辑
摘要: LeetCode地址:https://leetcode-cn.com/problems/delete-node-in-a-linked-list/ 描述: 请编写一个函数,使其可以删除某个链表中给定的(非末尾)节点,你将只被给定要求被删除的节点。 现有一个链表 -- head = [4,5,1,9] 阅读全文
posted @ 2019-05-23 16:28 夏落若的博客 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 地址: 描述: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The 阅读全文
posted @ 2019-04-30 22:43 夏落若的博客 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode.com/problems/kth-largest-element-in-an-array/ 描述: Find the kth largest element in an unsorted array. Note that it is the kth large 阅读全文
posted @ 2019-04-30 22:07 夏落若的博客 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode.com/problems/merge-sorted-array/ 描述: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. 阅读全文
posted @ 2019-04-30 21:51 夏落若的博客 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode.com/problems/sort-colors/ 描述: Given an array with n objects colored red, white or blue, sort them in-place so that objects of the 阅读全文
posted @ 2019-04-29 23:05 夏落若的博客 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode.com/problems/remove-element/ 描述: Given an array nums and a value val, remove all instances of that value in-place and return the n 阅读全文
posted @ 2019-04-29 00:46 夏落若的博客 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 地址:https://leetcode.com/problems/move-zeroes/ 项目描述: Given an array nums, write a function to move all 0's to the end of it while maintaining the relat 阅读全文
posted @ 2019-04-28 23:21 夏落若的博客 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 示例: 方法一: 方法二: 阅读全文
posted @ 2019-02-13 19:20 夏落若的博客 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目描述: 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。 你可以假设数组中无重复元素。 示例 1: 示例 2: 示例 3: 示例 4: 阅读全文
posted @ 2019-02-13 19:11 夏落若的博客 阅读(100) 评论(0) 推荐(0) 编辑