- 博客(9)
- 收藏
- 关注
原创 Search Insert Position
35. Search Insert Position描述:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no...
2018-01-30 20:35:07 118
原创 Remove Element
27. Remove Element描述:Given an array and a value, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the ...
2018-01-28 15:41:29 117
原创 Java中Stack类的学习笔记
StackStack(栈)是一种比较典型的数据结构,其元素满足后进先出(LIFO)的特点。Java中Stack的实现继承自Vector,所以其天然的具有了一些Vector的特点,所以栈也是线程安全的。class Stack extends Vector {}事实上,除了继承自Vector的那些方法之外,Stack只提供了5个方法:1.测试栈是否为空: boolean i
2018-01-27 16:00:31 484
原创 Valid Parentheses
20. Valid Parentheses描述:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()...
2018-01-27 15:45:12 324
原创 Roman to Integer
13. Roman to Integer描述:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.我的思路: 罗马数字计数规则: 罗马数字采用七个罗马字母作数字、即Ⅰ(1)、X(10)、C(100)、M(1000)、V(5)、L...
2018-01-26 15:47:09 154
原创 Palindrome Number
9. Palindrome Number描述:Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of converting the intege...
2018-01-25 15:47:21 108
原创 Remove Duplicates from Sorted Array
26. Remove Duplicates from Sorted Array描述:Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another...
2018-01-24 21:49:23 79
原创 Two Sum
题目:1. Two Sum描述:Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not...
2018-01-24 17:30:43 127
原创 Reverse Integer
题目:7 Reverse Integer描述:Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21注意:Assume we are ...
2018-01-24 17:09:25 127
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人