自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 资源 (5)
  • 收藏
  • 关注

原创 32. Longest Valid Parentheses

一,题目Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring i

2016-06-18 20:55:40 203

原创 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 in place with constant m

2016-06-13 23:15:30 167

原创 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 array, you must do this in

2016-06-13 21:55:27 176

原创 22. Generate Parentheses

一,题目Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()",

2016-06-13 21:13:23 183

原创 21. Merge Two Sorted Lists

一,题目Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.二,代码public ListNode mergeTwoLists(ListNode

2016-06-13 17:16:17 198

原创 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 "()[]{}" ar

2016-06-13 16:59:18 152

原创 19. Remove Nth Node From End of List

一,题目Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from th

2016-06-13 16:07:10 155

原创 16. 3Sum Closest

一,题目Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would ha

2016-06-13 15:12:28 163

原创 15.3Sum

一,题目Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must n

2016-06-13 13:32:17 148

原创 14. Longest Common Prefix

一,题目Write a function to find the longest common prefix string amongst an array of strings.二,思路使用StringBuffer存储相同的前缀.使用暴力枚举的办法,每次取出一个字符串,然后都与第一个字符串的相同位置字符比较.相同则继续,否则返回StringBuffer存储的内容三,代

2016-06-11 00:42:49 164

原创 9. Palindrome Number

一,题目Determine whether an integer is a palindrome. Do this without extra space.二,思路和整数翻转一样注意:负数都不是回文三,代码public boolean isPalindrome(int x) { if (x < 0) { return false;

2016-06-10 23:22:44 160

原创 8. String to Integer (atoi)

一,题目Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible inpu

2016-06-10 21:52:24 160

原创 2. Add Two Numbers

一,题目You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a l

2016-06-10 00:05:05 168

原创 7. Reverse Integer

一,题目Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321二,思路用一个变量记录转换的值每次模10取得最低位,记录的变量值乘以10然后加上这个最低位这个数字再除以10三,代码public int reverse(

2016-06-10 00:01:10 207

原创 5. Longest Palindromic Substring

一,题目Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.二,思路

2016-06-08 02:04:38 156

原创 3. Longest Substring Without Repeating Characters

一,题目Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the a

2016-06-08 00:28:19 185

原创 1,Two Sum

1,题目: 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.Example: Given nums = [

2016-06-07 00:25:17 159

原创 79. Word Search

Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically

2016-04-06 22:29:34 168

原创 线性表之单链表

在链表存储结构中,每个节点用于存储线性表的一个元素,每个节点不仅包含有所存元素本身的信息(数据域),还包含元素之间逻辑关系的信息,即前驱节点包含后继节点的地址信息,称为指针域,这样可以比较方便的查找后继节点的位置.我们再次讨论的单链表为了方便链表的操作,都是默认带头结点的.只要我们拿到了头结点我们就等于拿到了整个链表的节点一,基本操作1,头插法建立单链表    这样得到的链表节点顺序和插入

2016-04-06 22:14:53 945

原创 线性表之顺序表增强操作

一,线性表的一些增强操作1,合并有序顺序表两个索引,分别指向两个顺序表的0索引,然后进行相互比较大小,索引前移.需要注意的是,两个顺序表可能会有一个先遍历完,所以最后判断是否要有剩余未遍历的 2,删除某个范围内的元素和删除某个元素思路一致 3,将顺序表元素进行重组, 小于等于某个value的放在左端,大于这个value的放在右边类似快速排序的一趟排序过程. 使用

2016-04-04 19:03:26 214

原创 线性表之顺序表常见操作

顺序表顺序表采用连续的数据结构进行数据的存取,插入删除元素(非最后元素),需要移动元素,对于插入元素,需要考虑扩容.但是顺序表可以进行随机访问,对于插入删除操作相对较少,访问元素操作较多的类型,可以采用顺序表进行存储一,主要内容1,顺序表的插入元素到指定位置2,顺序表的删除指定位置元素3,获取指定位置元素4,获取指定元素的索引5,删除所有指定的元素6,删除指定索引位

2016-04-04 14:39:59 319

原创 二叉树--创建,删除,交换;查找节点的层数,某层多少节点,叶子节点到根节点的路径,LCA

2016-04-02 20:37:20 493

原创 二叉树--高度,宽度和节点个数

对于二叉树的算法问题,我们可以根据二叉树本身的定义的递归性质求解,或者使用对二叉树的遍历算法进行求解.下面我们看几个关于二叉树高度,宽度和节点个数的算法一,求二叉树的高度1,使用二叉树递归定义的性质求二叉树的高度如果根节点为空,返回0否则  递归求左子树高度  getHeightRecurse(root.left)递归求右子树高度  getHeightRecurse

2016-04-02 18:14:47 1167

原创 二叉树--遍历

二叉树的遍历一,二叉树的遍历定义二叉树的遍历是指按指定的规律对二叉树中的每个结点访问一次且仅访问一次.所谓访问是指对结点做某种处理,二叉树的基本组成:根结点、左子树、右子树。若能依次遍历这三部分,就是遍历了二叉树。1,二叉树的先中后序遍历若以L、D、R分别表示遍历左子树、遍历根结点和遍历右子树,则有六种遍历方案:DLR、LDR、LRD、DRL、RDL、RLD。若规定

2016-04-02 00:54:54 282

原创 二叉树前言

本篇章主要是二叉树的学习和描述.首先,老生常谈,说下二叉树的定义.二叉树(Binary tree)是n(n≥0)个结点的有限集合。 若n=0时称为空树,否则: ⑴ 有且只有一个特殊的称为树的根(Root)结点; ⑵ 若n>1时,其余的结点被分成为二个互不相交的子集T1,T2,分别称之为左、右子树,并且左、右子树又都是二叉树。 由此可知,二叉树的定义是递归的。所以关于很多二叉树的算法实现

2016-04-02 00:45:08 314

北京交通大学2016操作系统考研真题

北京交通大学2016操作系统考研真题北京交通大学2016操作系统考研真题

2017-12-10

操作系统原理(汤小丹)以及课后答案

操作系统原理(汤小丹)以及课后答案 pdf 操作系统原理(汤小丹)以及课后答案 操作系统原理(汤小丹)以及课后答案

2017-12-10

线性表之顺序表增强操作

线性表之顺序表增强操作

2016-04-04

线性表之顺序表常见操作

线性表之顺序表常见操作 增删改查,逆转等

2016-04-04

数据结构二叉树专题java代码实现

数据结构二叉树专题java代码实现

2016-04-02

空空如也

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

TA关注的人

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