Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your ...
分类:
其他好文 时间:
2018-03-09 14:11:34
阅读次数:
175
题目中文:没有重复字符的最长子串 题目难度:Medium 题目内容: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", ...
分类:
编程语言 时间:
2018-03-08 18:09:56
阅读次数:
141
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a ...
分类:
其他好文 时间:
2018-03-08 00:01:07
阅读次数:
168
题目描述: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 思路: 判断一个链表是否有环。 * 同个时间Faster走的比Slo ...
分类:
其他好文 时间:
2018-03-05 11:14:41
阅读次数:
181
Question: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-bal ...
分类:
其他好文 时间:
2018-03-01 14:53:58
阅读次数:
133
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the ...
分类:
其他好文 时间:
2018-02-27 23:30:00
阅读次数:
164
题目:Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in ...
分类:
编程语言 时间:
2018-02-27 16:02:34
阅读次数:
157
Question: Sort a linked list using insertion sort. Tips: 使用插入排序,对一个链表进行排序。 思路: 新建一个头结点newHead,设置一个pre指针,指向newHead。 cur指针,指向原来的头结点head。 当pre.next的值大于cu ...
分类:
其他好文 时间:
2018-02-27 12:44:39
阅读次数:
160
1.题目描述 Given a linked list, remove the nth node from the end of list and return its head. 删除链表中倒数第n个节点 For example, Given linked list: 1->2->3->4->5, ...
分类:
其他好文 时间:
2018-02-27 01:08:54
阅读次数:
180
一、双向链表(double linked list)如图26.5,是在单链表的每个结点中,再设置一个指向其前驱结点的指针域。双向链表的基本操作与单链表基本一样,除了插入和删除的时候需要更改两个指针变量,需要注意的是修改的顺序很重要,插入如图3-14-5,删除如图3-14-6。 链表的delete操作 ...
分类:
其他好文 时间:
2018-02-26 11:32:51
阅读次数:
198