题目
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...
分类:
其他好文 时间:
2014-06-17 21:38:12
阅读次数:
193
jQuery实现table隔行换色和鼠标经过变色
一、隔行换色
$("tr:odd").css("background-color","#eeeeee");
$("tr:even").css("background-color","#ffffff");
或者一行搞定:
$("table tr:nth-child(odd)").css("background-color","#eeeeee");
二、鼠标经过变色
$("tr").live({
mouseover:function(){
$(this)....
分类:
Web程序 时间:
2014-06-15 10:15:32
阅读次数:
329
Given a linked list, remove thenthnode from the
end of list and return its head.For example, Given linked list:
1->2->3->4->5, and n = 2. After re...
分类:
其他好文 时间:
2014-06-07 16:54:26
阅读次数:
221
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 rem...
分类:
其他好文 时间:
2014-05-26 09:08:23
阅读次数:
262
题目说:Try to do this in one pass
只用一遍遍历的话,p1先走n节点,p2再走,等到p1到达链表尾的时候p2正好在倒数第n+1个上面鸟
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode...
分类:
其他好文 时间:
2014-05-23 01:52:29
阅读次数:
331
Remove Nth Node From End of List删除链表倒数的第N个元素...
分类:
其他好文 时间:
2014-05-22 11:15:52
阅读次数:
170
【题目】
原文:
2.2 Implement an algorithm to find the nth to last element of a singly linked list.
译文:
实现一个算法从一个单链表中返回倒数第n个元素。
【分析】
【思路一】
(1)创建两个指针p1和p2,指向单链表的开始节点。
(2)使p2移动n-1个位置,使之指向从头...
分类:
其他好文 时间:
2014-05-22 09:03:53
阅读次数:
315
戳我去解题Given a linked list, remove thenthnode from
the end of list and return its head.For example, Given linked list:
1->2->3->4->5, and n = 2. Aft...
分类:
其他好文 时间:
2014-05-20 08:04:28
阅读次数:
291
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 removi...
分类:
其他好文 时间:
2014-05-19 09:16:49
阅读次数:
247
【题目】
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 the end, the linked list becomes 1->2->3->5.
Note:
Given n will ...
分类:
其他好文 时间:
2014-05-18 18:48:03
阅读次数:
269