本题比较简单,主要考察了单链表的创建与删除。
但是有一个问题需要着重的考虑,如何快速定位链表的倒数第n个节点。这就需要两个辅助节点,一个节点先走到正数第n个位置,然后两个辅助节点一块往后走,最后后面的节点的位置就是我们需要的倒数第n个节点。#include
#include
struct ListNode//定义节点
{
int value;
struct ListNode *ne...
分类:
其他好文 时间:
2015-04-12 22:49:42
阅读次数:
236
1 procedure Mainform.SetField(Sender: TField; var Text: string; 2 DisplayText: Boolean); 3 begin 4 Text := Sender.AsString ; 5 end; 6 7 procedur...
分类:
数据库 时间:
2015-04-12 22:35:43
阅读次数:
283
事务管理: 单个工作单元称为事务,我们将若干条sql命令组合在一起,形成存储过程、触发器等,利用存储过程和触发器可以进行事务管理。 编程基础介绍:函数、程序设计语句等。 程序设计语句: 1、begin ......end 中间插入若干条sql语句,我们将其视为一个单元。 2、跳转语句(goto语句)...
分类:
数据库 时间:
2015-04-12 20:37:58
阅读次数:
206
事务管理: 单个工作单元称为事务,我们将若干条sql命令组合在一起,形成存储过程、触发器等,利用存储过程和触发器可以进行事务管理。 编程基础介绍:函数、程序设计语句等。 程序设计语句: 1、begin ......end 中间插入若干条sql语句,我们将其视为一个单元。 2、跳转语句(goto语句)...
分类:
数据库 时间:
2015-04-12 19:12:20
阅读次数:
214
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...
分类:
其他好文 时间:
2015-04-12 17:44:42
阅读次数:
118
function _PCharLen(P: _PAnsiChr): Longint;{$IFNDEF LEGACY_PCHARLEN}begin Result := 0; if P nil then while P[Result] #0 do Inc(Result);end;喜欢理由:简洁如果是.....
分类:
其他好文 时间:
2015-04-12 17:30:14
阅读次数:
119
oracle 如何用触发器实现更新刚插入的数据create or replace trigger tr_namebefore inserton 表for each rowbegin:new.某字段='新值';end;修改A表的某条数据的某个字段AA(这个字段是规定好的),在保存后A表的该条数据的另一...
分类:
数据库 时间:
2015-04-12 13:25:11
阅读次数:
163
喔尽量分成一小节一小节的写。这样也难让大家看的清楚些。我这里有三种创建线程的方法。代码如下
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super
...
分类:
移动开发 时间:
2015-04-12 09:17:51
阅读次数:
166
12096 The SetStack Computer
Background from Wikipedia: “Set theory is a branch of mathematics created principally by the German mathe-matician Georg Cantor at the end of the 19th century.Initially co...
分类:
其他好文 时间:
2015-04-12 09:13:00
阅读次数:
144
#include
#define MAX_LENGTH 10
int main()
{
int a[MAX_LENGTH]={1,2,3,-2,4,-6,-8,5,3,1};
int i,j,beg,end,tmp,min=0x7fffffff; //beg和end分别为子数组中首末元素下标,min为无穷大的数
beg=end=tmp=0;
for(i=0;...
分类:
编程语言 时间:
2015-04-12 01:25:31
阅读次数:
170