Linked Lists

26/11/01


Click here to start


Table of Contents

Linked Lists

Linked Lists

Linked Lists

Pointer Functions

int * p;

Nodes

Notice that the node has two elements,

The use of parentheses is overrides the higher priority of the period operator,as follows :

Example

Placing info in a node

Delete

typedef struct node *pointer;

Specification of ADT List

ToFirst(L)

AtEnd(L) ? b

Insert(L,e)

Delete(L)

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

PPT Slide

Initialising a list

ListIsEmpty?

CurIsEmpty?

void ToFirst()

PPT Slide

AtLast?

PPT Slide

Advance

PPT Slide

PPT Slide

Create the node to insert

Insert at head

Inserting ...

PPT Slide

Delete a node

Stacks

Stack Operations

Array Implementation

Push

Pop

Underflow & Overflow

Better Representations of stack?

With Structures & Arrays ...

What do we use stacks for?

Balanced Expressions

Converting from infix to postfix

Evaluating postfix expressions

Author: Computer Science Dept.