Linked List - IIT Kgp

嚜燉inked List

July 21, 2009

Programming and Data Structure

1

Introduction

? A linked list is a data structure which can

change during execution.

每 Successive elements are connected by pointers.

每 Last element points to NULL.

head

每 It can grow or shrink in size during execution of

a program.

每 It can be made just as long as required.

每 It does not waste memory space.

A

July 21, 2009

B

Programming and Data Structure

C

2

? Keeping track of a linked list:

每 Must know the pointer to the first element of

the list (called start, head, etc.).

? Linked lists provide flexibility in allowing

the items to be rearranged efficiently.

每 Insert an element.

每 Delete an element.

July 21, 2009

Programming and Data Structure

3

Illustration: Insertion

A

B

X

A

C

Item to be

inserted

B

C

X

July 21, 2009

Programming and Data Structure

4

Illustration: Deletion

Item to be deleted

July 21, 2009

A

B

C

A

B

C

Programming and Data Structure

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download