Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
static void InsertAfter(Link prev, int i)
|
||||
{
|
||||
if (prev.next != null)
|
||||
{
|
||||
prev.next.prev = new Link() { item = i, prev = prev, next = prev.next };
|
||||
prev.next = prev.next.prev;
|
||||
}
|
||||
else
|
||||
prev.next = new Link() { item = i, prev = prev };
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
static void Main()
|
||||
{
|
||||
//Create A(5)->B(7)
|
||||
var A = new Link() { item = 5 };
|
||||
InsertAfter(A, 7);
|
||||
//Insert C(15) between A and B
|
||||
InsertAfter(A, 15);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue