自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

ShadowAJ

学习-进步

  • 博客(13)
  • 资源 (1)
  • 收藏
  • 关注

原创 703-Kth Largest Element in a Stream

题目Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.设计一个类来查找流中第k个最大元素。请注意,它是排序顺序中的第k个最大元素,而不是第k个不同...

2019-05-23 23:33:07 179

原创 232-Implement Queue using Stacks

题目Implement实现 the following operations操作 of a queue队列 using stacks堆栈.push(x) – Push element x to the back of queue.pop() – Removes the element from in front of queue.peek() – Get the front elemen...

2019-05-23 23:32:42 155

原创 20-Valid Parentheses

题目Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets括号 must be closed by the same type ...

2019-05-23 23:32:04 139

原创 24-Swap Nodes in Pairs

题目Given a linked list, swap交换 every two adjacent相邻的 nodes and return its head.You may not modify the values in the list’s nodes, only nodes itself may be changed.Example:Given 1->2->3->4,...

2019-05-23 23:31:32 118

原创 142-Linked List Cycle II

题目Given a linked list, return the node where the cycle begins.返回环开始的那个节点 If there is no cycle, return null.没环的话,就返回nullTo represent表示 a cycle in the given linked list, we use an integer整数 pos which ...

2019-05-23 23:29:56 166

原创 141-Linked List Cycle

题目Given a linked list, determine确定 if it has a cycle in it.To represent代表 a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where t...

2019-05-23 23:29:05 89

原创 206-Reverse Linked list

文章目录题目思路方法1:迭代方法2:递归题目Reverse 反转 a singly linked list 单向链表.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed ei...

2019-05-23 23:28:31 145

原创 509-Fibonacci Number

题目The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is,F(0) = 0, ...

2019-05-23 23:27:38 122

原创 02-Add Two Numbers

文章目录题目思路Java版本python版本关于python解法的理解:题目You are given two non-empty linked lists(两个 非空 的链表) representing(表示) two non-negative(非负) integers(整数).The digits are stored in reverse order and each of their...

2019-05-13 18:53:10 250

原创 09-Palindrome Number

文章目录Problem使用字符串的解法(python)不使用str的解法(python)另外一种直接的思路JAVA版解法ProblemDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Inp...

2019-05-12 16:45:58 172

原创 02- two sum

"""给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。示例:给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]Given...

2019-05-11 21:11:08 119

原创 07-Reverse Integer(整数反转)

题目:给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。示例 1:输入: 123输出: 321示例 2:输入: -123输出: -321示例 3:输入: 120输出: 21注意:假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−231, 231 − 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。解法:class S...

2019-05-10 23:30:10 222

原创 深入浅出索引(上)

一句话简单来说,索引的出现其实就是为了提高数据查询的效率,就像书的目录一样。一本500页的书,如果你想快速找到其中的某一个知识点,在不借助目录的情况下,那我估计你可得找一会儿。同样,对于数据库的表而言,索引其实就是它的“目录”。索引的常见模型索引的出现是为了提高查询效率,但是实现索引的方式却有很多种,所以这里也就引入了索引模型的概念。可以用于提高读写效率的数据结构很多,这里我先给你介绍三种常见...

2019-05-08 22:26:58 204

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除