SlideShare a Scribd company logo
Course: BSC CS
Subject: Data Structure
Unit-2
Link List, Stack, Queue
DEFINITION: STACK
 An ordered collection of data items
 Can be accessed at only one end (the top)
 Stacks are LIFO structures, providing
 Add Item (=PUSH) Methods
 Remove Item (=POP) Methods
 They are a simple way to build a collection
 No indexing necessary
 Size of collection must not be predefined
 But: extremely reduced accessibility
 initializeStack: Initializes the stack to an empty state
 destroyStack: Removes all the elements from the
stack, leaving the stack empty
 isEmptyStack: Checks whether the stack is empty. If
empty, it returns true; otherwise, it returns false
BASIC OPERATIONS ON A STACK
CONT..
 isFullStack: Checks whether the stack is full.
 If full, it returns true; otherwise, it returns false
 push:
 Add new element to the top of the stack
 The input consists of the stack and the new
element.
 Prior to this operation, the stack must exist
and must not be full
CONT..
 top: Returns the top element of the stack. Prior
to this operation, the stack must exist and must
not be empty.
 pop: Removes the top element of the stack. Prior
to this operation, the stack must exist and must
not be empty.
STACKS: PROPERTIES
 Possible actions:
 PUSH an object (e.g. a plate) ontodispenser
 POP object out of dispenser
 Examples:
 Finding Palindromes
 Bracket Parsing
 RPN
 RECURSION !
APPLICATIONS USING A STACK
• Sometimes, the best way to solve a problem is by
solving a smaller version of the exact same
problem first
• Recursion is a technique that solves a problem by
solving a smaller problem of the same type
• A procedure that is defined in terms of itself
RECURSION
FACTORIAL
a! = 1 * 2 * 3 * ... * (a-1) * a
a! = a * (a-1)!
a!
a * (a-1)!
remember
...splitting up the problem into a smaller problem of the
same type...
 INFIX: From our schools times we have been familiar with the
expressions in which operands surround the operator,
 e.g. x+y, 6*3 etc this way of writing the Expressions is called
infix notation.
 POSTFIX: Postfix notation are also Known as Reverse Polish
Notation (RPN). They are different from the infix and prefix
notations in the sense that in the postfix notation, operator
comes after the operands,
 e.g. xy+, xyz+* etc.
 PREFIX: Prefix notation also Known as Polish notation.In the
prefix notation, as the name only suggests, operator comes
before the operands,
 e.g. +xy, *+xyz etc.
INFIX, POSTFIX AND PREFIX EXPRESSIONS
Using a Queue
Representation Of Queue
Operations On Queue
 Circular Queue
Priority Queue
Array Representation of Priority Queue
Double Ended Queue
Applications of Queue
WHAT IS A QUEUE?
 A queue system is a linear list in which deletions can take
place only at one end the “front” of the list, and the
insertions can take place only at the other end of the list,
the “back” .
 Is called a First-In-First-Out(FIFO)
THE QUEUE OPERATIONS
 A queue is like a line of people waiting for a bank teller.
 The queue has a front and a rear.
THE QUEUE OPERATIONS
 New people must enter the queue at the rear.
 The C++ queue class calls this a push, although it is
usually called an enqueue operation.
THE QUEUE OPERATIONS
 When an item is taken from the queue, it always
comes from the front.
 The C++ queue calls this a pop, although it is
usually called a dequeue operation.
$ $
Front
Rear
OPERATIONS ON QUEUES
 Insert(item): (also called enqueue)
 It adds a new item to the tail of the queue
 Remove( ): (also called delete or dequeue)
 It deletes the head item of the queue, and returns to the
caller.
 If the queue is already empty, this operation returns NULL
 getHead( ):
 Returns the value in the head element of the queue
 getTail( ):
 Returns the value in the tail element of the queue
 isEmpty( )
 Returns true if the queue has no items
 size( )
 Returns the number of items in the queue
The Queue Class
 The C++ standard template
library has a queue template
class.
 The template parameter is
the type of the items that can
be put in the queue.
template <class Item>
class queue<Item>
{
public:
queue( );
void push(const Item& entry);
void pop( );
bool empty( ) const;
Item front( ) const;
…
};
ARRAY IMPLEMENTATION
 A queue can be implemented with an array, as shown here.
For example, this queue contains the integers 4 (at the
front), 8 and 6 (at the rear).
[ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . .
An array of integers
to implement a
queue of integers
4 8 6
We don't care what's in
this part of the array.
ARRAY IMPLEMENTATION
 The easiest implementation also keeps track
of the number of items in the queue and the
index of the first element (at the front of the
queue), the last element (at the rear).
[ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . .
4 8 6
size3
first0
last2
AN ENQUEUE OPERATION
 When an element enters the queue, size is
incremented, and last changes, too.
[ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . .
28 6
size3
first1
last3
AT THE END OF THE ARRAY
 There is special behaviour at the end of the
array.
 For example, suppose we want to add a new
element to this queue, where the last index is
[5]:
[ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
2 16
size3
first3
last5
AT THE END OF THE ARRAY
 The new element goes at the front of the
array (if that spot isn’t already used):
[ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ]
2 16
size4
first3
last0
4
ARRAY IMPLEMENTATION
 Easy to implement
 But it has a limited capacity with a fixed array
 Or you must use a dynamic array for an
unbounded capacity
 Special behavior is needed when the rear reaches
the end of the array.
[ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . .
4 8 6
size3
first0
last2
CIRCULAR QUEUE
 When the queue reaches the end of the array, it “wraps around”
and the rear of the queue starts from index 0.
 A The figure below demonstrates the situation.
25
PRIORITY QUEUES
 A priority queue is a collection of zero or more
elements  each element has a priority or value
 Unlike the FIFO queues, the order of deletion from
a priority queue (e.g., who gets served next) is
determined by the element priority
 Elements are deleted by increasing or decreasing
order of priority rather than by the order in which
they arrived in the queue
26
PRIORITY QUEUES
 Operations performed on priority queues
 1) Find an element, 2) insert a new element, 3) delete an element,
etc.
 Two kinds of (Min, Max) priority queues exist
 In a Min priority queue, find/delete operation finds/deletes the
element with minimum priority
 In a Max priority queue, find/delete operation finds/deletes the
element with maximum priority
 Two or more elements can have the same priority
DEQUES
 A deque is a double-ended queue
 Insertions and deletions can occur at either end
 Implementation is similar to that for queues
 Deques are not heavily used
 You should know what a deque is, but we won’t
explore them much further
Ucommuting pipes
DEQUE (DOUBLE-ENDED QUEUE)[1]
Implemented by the class Arraydeque in Java 6 seen as a
doubly linked list with a head (right) and a tail (left) and
insert and remove at either ends.
head
tail
..... 43 1 625
5
1 2
4
6
headtail
3
QUEUE APPLICATIONS
 Real life examples
 Waiting in line
 Waiting on hold for tech support
 Applications related to Computer Science
 Threads
 Job scheduling (e.g. Round-Robin algorithm for CPU
allocation)
LINKED LIST IMPLEMENTATION[2]
10
15
7
null
13
 A queue can also be implemented with a linked
list with both a head and a tail pointer.
head_ptr
tail_ptr
LINKED LIST IMPLEMENTATION[3]
10
15
7
null
13
 Which end do you think is the front of the queue?
Why?
head_ptr
tail_ptr
LINKED LIST IMPLEMENTATION[4]
10
15
7
null
head_ptr
13
 The head_ptr points to the front of the list.
 Because it is harder to remove items from the tail of the list.
tail_ptr
Front
Rear
LINKED LIST
 Linkedlist an ordered collection of data in which each
element contains the location of the next element.
 Each element contains two parts: data and link.
 The link contains a pointer (an address) that identifies
the next element in the list.
 Singly linked list
 The link in the last element contains a null pointer,
indicating the end of the list.
Node[5]
 Nodes : the elements in a linked list.
 The nodes in a linked list are called self-referential records.
 Each instance of the record contains a pointer to another
instance of the same structural type.
35
SENTINEL NODES
 To simplify programming, two special nodes have been added at
both ends of the doubly-linked list.
 Head and tail are dummy nodes, also called sentinels, do not store
any data elements.
 Head: header sentinel has a null-prev reference (link).
 Tail: trailer sentinel has a null-next reference (link).
36
header trailer
Empty Doubly-Linked List:[6]
Using sentinels, we have no null-
links; instead, we have:
head.next = tail
tail.prev = head
Singl Node List:
Size = 1
This single node is the first node,
and also is the last node:
first node is head.next
last node is tail.prev
trailerheader
first last
 In linear linked lists if a list is traversed (all the elements visited)
an external pointer to the list must be preserved in order to be
able to reference the list again.
 Circular linked lists can be used to help the traverse the same list
again and again if needed.
 A circular list is very similar to the linear list where in the
circular list the pointer of the last node points not NULL but the
first node.
CIRCULAR LINKED LISTS
CIRCULAR LINKED LISTS
 In a circular linked list there are two methods to know if a
node is the first node or not.
 Either a external pointer, list, points the first node or
 A header node is placed as the first node of the circular
list.
 The header node can be separated from the others by either
heaving a sentinel value as the info part or having a
dedicated flag variable to specify if the node is a header node
or not.
REFERENCES
 An introduction to Datastructure with application by jean Trembley and
sorrenson
 Data structures by schaums and series –seymour lipschutz
 http://en.wikipedia.org/wiki/Book:Data_structures
 http://www.amazon.com/Data-Structures-Algorithms
 http://www.amazon.in/Data-Structures-Algorithms-Made-
Easy/dp/0615459811/
 http://www.amazon.in/Data-Structures-SIE-Seymour-Lipschutz/dp
 List of images
1) http://whttp://www.amazon.in/Data-Structures-SIE-Seymour-
Lipschutz/dq
2) ww.amazon.in/Data-Structures-linkedlist
3) ww.amazon.in/Data-Structures-linkedlist
4) ww.amazon.in/Data-Structures-linkedlist
5) ww.amazon.in/Data-Structures-linkedlist
6) ww.amazon.in/Data-Structures-doubly linkedlist

More Related Content

What's hot

Stacks, Queues, Deques
Stacks, Queues, DequesStacks, Queues, Deques
Stacks, Queues, Deques
A-Tech and Software Development
 
Stacks and queue
Stacks and queueStacks and queue
Stacks and queueAmit Vats
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
DurgaDeviCbit
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
Zidny Nafan
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsAakash deep Singhal
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
EktaVaswani2
 
Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)
Adam Mukharil Bachtiar
 
Linked list
Linked listLinked list
Linked list
Trupti Agrawal
 
Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queuestech4us
 
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)
Roman Rodomansky
 
Data Structure Lecture 7
Data Structure Lecture 7Data Structure Lecture 7
Data Structure Lecture 7Teksify
 
Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)
EngineerBabu
 
Linked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory AllocationLinked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory Allocation
Prof Ansari
 
stack & queue
stack & queuestack & queue
stack & queue
manju rani
 
linked list
linked list linked list
linked list
Narendra Chauhan
 
DSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notesDSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notes
swathirajstar
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8
sumitbardhan
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
swajahatr
 
Stack and queue
Stack and queueStack and queue
Stack and queue
Katang Isip
 

What's hot (20)

Stacks, Queues, Deques
Stacks, Queues, DequesStacks, Queues, Deques
Stacks, Queues, Deques
 
Stacks and queue
Stacks and queueStacks and queue
Stacks and queue
 
Algo>ADT list & linked list
Algo>ADT list & linked listAlgo>ADT list & linked list
Algo>ADT list & linked list
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
 
Queue Data Structure
Queue Data StructureQueue Data Structure
Queue Data Structure
 
Lecture 3 data structures and algorithms
Lecture 3 data structures and algorithmsLecture 3 data structures and algorithms
Lecture 3 data structures and algorithms
 
stacks and queues
stacks and queuesstacks and queues
stacks and queues
 
Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)Data Structure (Dynamic Array and Linked List)
Data Structure (Dynamic Array and Linked List)
 
Linked list
Linked listLinked list
Linked list
 
Stacks & Queues
Stacks & QueuesStacks & Queues
Stacks & Queues
 
Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)Queue Data Structure (w/ php egs)
Queue Data Structure (w/ php egs)
 
Data Structure Lecture 7
Data Structure Lecture 7Data Structure Lecture 7
Data Structure Lecture 7
 
Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)Array Presentation (EngineerBaBu.com)
Array Presentation (EngineerBaBu.com)
 
Linked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory AllocationLinked List Static and Dynamic Memory Allocation
Linked List Static and Dynamic Memory Allocation
 
stack & queue
stack & queuestack & queue
stack & queue
 
linked list
linked list linked list
linked list
 
DSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notesDSA UNIT II ARRAY AND LIST - notes
DSA UNIT II ARRAY AND LIST - notes
 
358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8358 33 powerpoint-slides_8-linked-lists_chapter-8
358 33 powerpoint-slides_8-linked-lists_chapter-8
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 

Similar to Bsc cs ii dfs u-2 linklist,stack,queue

CEN 235 4. Abstract Data Types - Queue and Stack.pdf
CEN 235 4. Abstract Data Types - Queue and Stack.pdfCEN 235 4. Abstract Data Types - Queue and Stack.pdf
CEN 235 4. Abstract Data Types - Queue and Stack.pdf
vtunali
 
LEC4-DS ALGO.pdf
LEC4-DS  ALGO.pdfLEC4-DS  ALGO.pdf
LEC4-DS ALGO.pdf
MuhammadUmerIhtisham
 
basics of queues
basics of queuesbasics of queues
basics of queues
sirmanohar
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
SeethaDinesh
 
Data Structures by Maneesh Boddu
Data Structures by Maneesh BodduData Structures by Maneesh Boddu
Data Structures by Maneesh Boddu
maneesh boddu
 
DSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdfDSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdf
Bharati Vidyapeeth COE, Navi Mumbai
 
Stack.pptx
Stack.pptxStack.pptx
Stack.pptx
SherinRappai
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
pinakspatel
 
VCE Unit 03vv.pptx
VCE Unit 03vv.pptxVCE Unit 03vv.pptx
VCE Unit 03vv.pptx
skilljiolms
 
Review of basic data structures
Review of basic data structuresReview of basic data structures
Review of basic data structuresDeepa Rani
 
Difference between stack and queue
Difference between stack and queueDifference between stack and queue
Difference between stack and queue
Pulkitmodi1998
 
Module 2 ppt.pptx
Module 2 ppt.pptxModule 2 ppt.pptx
Module 2 ppt.pptx
SonaPathak4
 
Stack & Queue
Stack & QueueStack & Queue
Stack & Queue
Hasan Mahadi Riaz
 
LEC3-DS ALGO(updated).pdf
LEC3-DS  ALGO(updated).pdfLEC3-DS  ALGO(updated).pdf
LEC3-DS ALGO(updated).pdf
MuhammadUmerIhtisham
 
U3.stack queue
U3.stack queueU3.stack queue
U3.stack queue
Ssankett Negi
 
chapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdfchapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdf
ssuserff72e4
 
Queues and Stacks
Queues and StacksQueues and Stacks
Queues and Stacks
Prof Ansari
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
Adam Mukharil Bachtiar
 

Similar to Bsc cs ii dfs u-2 linklist,stack,queue (20)

CEN 235 4. Abstract Data Types - Queue and Stack.pdf
CEN 235 4. Abstract Data Types - Queue and Stack.pdfCEN 235 4. Abstract Data Types - Queue and Stack.pdf
CEN 235 4. Abstract Data Types - Queue and Stack.pdf
 
LEC4-DS ALGO.pdf
LEC4-DS  ALGO.pdfLEC4-DS  ALGO.pdf
LEC4-DS ALGO.pdf
 
basics of queues
basics of queuesbasics of queues
basics of queues
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
Data Structures by Maneesh Boddu
Data Structures by Maneesh BodduData Structures by Maneesh Boddu
Data Structures by Maneesh Boddu
 
DSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdfDSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdf
 
Stack.pptx
Stack.pptxStack.pptx
Stack.pptx
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
 
VCE Unit 03vv.pptx
VCE Unit 03vv.pptxVCE Unit 03vv.pptx
VCE Unit 03vv.pptx
 
Review of basic data structures
Review of basic data structuresReview of basic data structures
Review of basic data structures
 
Difference between stack and queue
Difference between stack and queueDifference between stack and queue
Difference between stack and queue
 
Module 2 ppt.pptx
Module 2 ppt.pptxModule 2 ppt.pptx
Module 2 ppt.pptx
 
Stack & Queue
Stack & QueueStack & Queue
Stack & Queue
 
LEC3-DS ALGO(updated).pdf
LEC3-DS  ALGO(updated).pdfLEC3-DS  ALGO(updated).pdf
LEC3-DS ALGO(updated).pdf
 
Lecture 2d queues
Lecture 2d queuesLecture 2d queues
Lecture 2d queues
 
Queue
QueueQueue
Queue
 
U3.stack queue
U3.stack queueU3.stack queue
U3.stack queue
 
chapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdfchapter10-queue-161018120329.pdf
chapter10-queue-161018120329.pdf
 
Queues and Stacks
Queues and StacksQueues and Stacks
Queues and Stacks
 
Data Structure (Queue)
Data Structure (Queue)Data Structure (Queue)
Data Structure (Queue)
 

More from Rai University

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University
Rai University
 
Mm unit 4point2
Mm unit 4point2Mm unit 4point2
Mm unit 4point2
Rai University
 
Mm unit 4point1
Mm unit 4point1Mm unit 4point1
Mm unit 4point1
Rai University
 
Mm unit 4point3
Mm unit 4point3Mm unit 4point3
Mm unit 4point3
Rai University
 
Mm unit 3point2
Mm unit 3point2Mm unit 3point2
Mm unit 3point2
Rai University
 
Mm unit 3point1
Mm unit 3point1Mm unit 3point1
Mm unit 3point1
Rai University
 
Mm unit 2point2
Mm unit 2point2Mm unit 2point2
Mm unit 2point2
Rai University
 
Mm unit 2 point 1
Mm unit 2 point 1Mm unit 2 point 1
Mm unit 2 point 1
Rai University
 
Mm unit 1point3
Mm unit 1point3Mm unit 1point3
Mm unit 1point3
Rai University
 
Mm unit 1point2
Mm unit 1point2Mm unit 1point2
Mm unit 1point2
Rai University
 
Mm unit 1point1
Mm unit 1point1Mm unit 1point1
Mm unit 1point1
Rai University
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Rai University
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Rai University
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditure
Rai University
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public finance
Rai University
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introduction
Rai University
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflation
Rai University
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economics
Rai University
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructure
Rai University
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competition
Rai University
 

More from Rai University (20)

Brochure Rai University
Brochure Rai University Brochure Rai University
Brochure Rai University
 
Mm unit 4point2
Mm unit 4point2Mm unit 4point2
Mm unit 4point2
 
Mm unit 4point1
Mm unit 4point1Mm unit 4point1
Mm unit 4point1
 
Mm unit 4point3
Mm unit 4point3Mm unit 4point3
Mm unit 4point3
 
Mm unit 3point2
Mm unit 3point2Mm unit 3point2
Mm unit 3point2
 
Mm unit 3point1
Mm unit 3point1Mm unit 3point1
Mm unit 3point1
 
Mm unit 2point2
Mm unit 2point2Mm unit 2point2
Mm unit 2point2
 
Mm unit 2 point 1
Mm unit 2 point 1Mm unit 2 point 1
Mm unit 2 point 1
 
Mm unit 1point3
Mm unit 1point3Mm unit 1point3
Mm unit 1point3
 
Mm unit 1point2
Mm unit 1point2Mm unit 1point2
Mm unit 1point2
 
Mm unit 1point1
Mm unit 1point1Mm unit 1point1
Mm unit 1point1
 
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,Bdft ii, tmt, unit-iii,  dyeing & types of dyeing,
Bdft ii, tmt, unit-iii, dyeing & types of dyeing,
 
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02Bsc agri  2 pae  u-4.4 publicrevenue-presentation-130208082149-phpapp02
Bsc agri 2 pae u-4.4 publicrevenue-presentation-130208082149-phpapp02
 
Bsc agri 2 pae u-4.3 public expenditure
Bsc agri  2 pae  u-4.3 public expenditureBsc agri  2 pae  u-4.3 public expenditure
Bsc agri 2 pae u-4.3 public expenditure
 
Bsc agri 2 pae u-4.2 public finance
Bsc agri  2 pae  u-4.2 public financeBsc agri  2 pae  u-4.2 public finance
Bsc agri 2 pae u-4.2 public finance
 
Bsc agri 2 pae u-4.1 introduction
Bsc agri  2 pae  u-4.1 introductionBsc agri  2 pae  u-4.1 introduction
Bsc agri 2 pae u-4.1 introduction
 
Bsc agri 2 pae u-3.3 inflation
Bsc agri  2 pae  u-3.3  inflationBsc agri  2 pae  u-3.3  inflation
Bsc agri 2 pae u-3.3 inflation
 
Bsc agri 2 pae u-3.2 introduction to macro economics
Bsc agri  2 pae  u-3.2 introduction to macro economicsBsc agri  2 pae  u-3.2 introduction to macro economics
Bsc agri 2 pae u-3.2 introduction to macro economics
 
Bsc agri 2 pae u-3.1 marketstructure
Bsc agri  2 pae  u-3.1 marketstructureBsc agri  2 pae  u-3.1 marketstructure
Bsc agri 2 pae u-3.1 marketstructure
 
Bsc agri 2 pae u-3 perfect-competition
Bsc agri  2 pae  u-3 perfect-competitionBsc agri  2 pae  u-3 perfect-competition
Bsc agri 2 pae u-3 perfect-competition
 

Recently uploaded

Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
Vivekanand Anglo Vedic Academy
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
Excellence Foundation for South Sudan
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 

Recently uploaded (20)

Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Sectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdfSectors of the Indian Economy - Class 10 Study Notes pdf
Sectors of the Indian Economy - Class 10 Study Notes pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 

Bsc cs ii dfs u-2 linklist,stack,queue

  • 1. Course: BSC CS Subject: Data Structure Unit-2 Link List, Stack, Queue
  • 2. DEFINITION: STACK  An ordered collection of data items  Can be accessed at only one end (the top)  Stacks are LIFO structures, providing  Add Item (=PUSH) Methods  Remove Item (=POP) Methods  They are a simple way to build a collection  No indexing necessary  Size of collection must not be predefined  But: extremely reduced accessibility
  • 3.  initializeStack: Initializes the stack to an empty state  destroyStack: Removes all the elements from the stack, leaving the stack empty  isEmptyStack: Checks whether the stack is empty. If empty, it returns true; otherwise, it returns false BASIC OPERATIONS ON A STACK
  • 4. CONT..  isFullStack: Checks whether the stack is full.  If full, it returns true; otherwise, it returns false  push:  Add new element to the top of the stack  The input consists of the stack and the new element.  Prior to this operation, the stack must exist and must not be full
  • 5. CONT..  top: Returns the top element of the stack. Prior to this operation, the stack must exist and must not be empty.  pop: Removes the top element of the stack. Prior to this operation, the stack must exist and must not be empty.
  • 6. STACKS: PROPERTIES  Possible actions:  PUSH an object (e.g. a plate) ontodispenser  POP object out of dispenser
  • 7.  Examples:  Finding Palindromes  Bracket Parsing  RPN  RECURSION ! APPLICATIONS USING A STACK
  • 8. • Sometimes, the best way to solve a problem is by solving a smaller version of the exact same problem first • Recursion is a technique that solves a problem by solving a smaller problem of the same type • A procedure that is defined in terms of itself RECURSION
  • 9. FACTORIAL a! = 1 * 2 * 3 * ... * (a-1) * a a! = a * (a-1)! a! a * (a-1)! remember ...splitting up the problem into a smaller problem of the same type...
  • 10.  INFIX: From our schools times we have been familiar with the expressions in which operands surround the operator,  e.g. x+y, 6*3 etc this way of writing the Expressions is called infix notation.  POSTFIX: Postfix notation are also Known as Reverse Polish Notation (RPN). They are different from the infix and prefix notations in the sense that in the postfix notation, operator comes after the operands,  e.g. xy+, xyz+* etc.  PREFIX: Prefix notation also Known as Polish notation.In the prefix notation, as the name only suggests, operator comes before the operands,  e.g. +xy, *+xyz etc. INFIX, POSTFIX AND PREFIX EXPRESSIONS
  • 11. Using a Queue Representation Of Queue Operations On Queue  Circular Queue Priority Queue Array Representation of Priority Queue Double Ended Queue Applications of Queue
  • 12. WHAT IS A QUEUE?  A queue system is a linear list in which deletions can take place only at one end the “front” of the list, and the insertions can take place only at the other end of the list, the “back” .  Is called a First-In-First-Out(FIFO)
  • 13. THE QUEUE OPERATIONS  A queue is like a line of people waiting for a bank teller.  The queue has a front and a rear.
  • 14. THE QUEUE OPERATIONS  New people must enter the queue at the rear.  The C++ queue class calls this a push, although it is usually called an enqueue operation.
  • 15. THE QUEUE OPERATIONS  When an item is taken from the queue, it always comes from the front.  The C++ queue calls this a pop, although it is usually called a dequeue operation. $ $ Front Rear
  • 16. OPERATIONS ON QUEUES  Insert(item): (also called enqueue)  It adds a new item to the tail of the queue  Remove( ): (also called delete or dequeue)  It deletes the head item of the queue, and returns to the caller.  If the queue is already empty, this operation returns NULL  getHead( ):  Returns the value in the head element of the queue  getTail( ):  Returns the value in the tail element of the queue  isEmpty( )  Returns true if the queue has no items  size( )  Returns the number of items in the queue
  • 17. The Queue Class  The C++ standard template library has a queue template class.  The template parameter is the type of the items that can be put in the queue. template <class Item> class queue<Item> { public: queue( ); void push(const Item& entry); void pop( ); bool empty( ) const; Item front( ) const; … };
  • 18. ARRAY IMPLEMENTATION  A queue can be implemented with an array, as shown here. For example, this queue contains the integers 4 (at the front), 8 and 6 (at the rear). [ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . . An array of integers to implement a queue of integers 4 8 6 We don't care what's in this part of the array.
  • 19. ARRAY IMPLEMENTATION  The easiest implementation also keeps track of the number of items in the queue and the index of the first element (at the front of the queue), the last element (at the rear). [ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . . 4 8 6 size3 first0 last2
  • 20. AN ENQUEUE OPERATION  When an element enters the queue, size is incremented, and last changes, too. [ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . . 28 6 size3 first1 last3
  • 21. AT THE END OF THE ARRAY  There is special behaviour at the end of the array.  For example, suppose we want to add a new element to this queue, where the last index is [5]: [ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] 2 16 size3 first3 last5
  • 22. AT THE END OF THE ARRAY  The new element goes at the front of the array (if that spot isn’t already used): [ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] 2 16 size4 first3 last0 4
  • 23. ARRAY IMPLEMENTATION  Easy to implement  But it has a limited capacity with a fixed array  Or you must use a dynamic array for an unbounded capacity  Special behavior is needed when the rear reaches the end of the array. [ 0 ] [1] [ 2 ] [ 3 ] [ 4 ] [ 5 ] . . . 4 8 6 size3 first0 last2
  • 24. CIRCULAR QUEUE  When the queue reaches the end of the array, it “wraps around” and the rear of the queue starts from index 0.  A The figure below demonstrates the situation.
  • 25. 25 PRIORITY QUEUES  A priority queue is a collection of zero or more elements  each element has a priority or value  Unlike the FIFO queues, the order of deletion from a priority queue (e.g., who gets served next) is determined by the element priority  Elements are deleted by increasing or decreasing order of priority rather than by the order in which they arrived in the queue
  • 26. 26 PRIORITY QUEUES  Operations performed on priority queues  1) Find an element, 2) insert a new element, 3) delete an element, etc.  Two kinds of (Min, Max) priority queues exist  In a Min priority queue, find/delete operation finds/deletes the element with minimum priority  In a Max priority queue, find/delete operation finds/deletes the element with maximum priority  Two or more elements can have the same priority
  • 27. DEQUES  A deque is a double-ended queue  Insertions and deletions can occur at either end  Implementation is similar to that for queues  Deques are not heavily used  You should know what a deque is, but we won’t explore them much further
  • 28. Ucommuting pipes DEQUE (DOUBLE-ENDED QUEUE)[1] Implemented by the class Arraydeque in Java 6 seen as a doubly linked list with a head (right) and a tail (left) and insert and remove at either ends. head tail ..... 43 1 625 5 1 2 4 6 headtail 3
  • 29. QUEUE APPLICATIONS  Real life examples  Waiting in line  Waiting on hold for tech support  Applications related to Computer Science  Threads  Job scheduling (e.g. Round-Robin algorithm for CPU allocation)
  • 30. LINKED LIST IMPLEMENTATION[2] 10 15 7 null 13  A queue can also be implemented with a linked list with both a head and a tail pointer. head_ptr tail_ptr
  • 31. LINKED LIST IMPLEMENTATION[3] 10 15 7 null 13  Which end do you think is the front of the queue? Why? head_ptr tail_ptr
  • 32. LINKED LIST IMPLEMENTATION[4] 10 15 7 null head_ptr 13  The head_ptr points to the front of the list.  Because it is harder to remove items from the tail of the list. tail_ptr Front Rear
  • 33. LINKED LIST  Linkedlist an ordered collection of data in which each element contains the location of the next element.  Each element contains two parts: data and link.  The link contains a pointer (an address) that identifies the next element in the list.  Singly linked list  The link in the last element contains a null pointer, indicating the end of the list.
  • 34. Node[5]  Nodes : the elements in a linked list.  The nodes in a linked list are called self-referential records.  Each instance of the record contains a pointer to another instance of the same structural type.
  • 35. 35 SENTINEL NODES  To simplify programming, two special nodes have been added at both ends of the doubly-linked list.  Head and tail are dummy nodes, also called sentinels, do not store any data elements.  Head: header sentinel has a null-prev reference (link).  Tail: trailer sentinel has a null-next reference (link).
  • 36. 36 header trailer Empty Doubly-Linked List:[6] Using sentinels, we have no null- links; instead, we have: head.next = tail tail.prev = head Singl Node List: Size = 1 This single node is the first node, and also is the last node: first node is head.next last node is tail.prev trailerheader first last
  • 37.  In linear linked lists if a list is traversed (all the elements visited) an external pointer to the list must be preserved in order to be able to reference the list again.  Circular linked lists can be used to help the traverse the same list again and again if needed.  A circular list is very similar to the linear list where in the circular list the pointer of the last node points not NULL but the first node. CIRCULAR LINKED LISTS
  • 38. CIRCULAR LINKED LISTS  In a circular linked list there are two methods to know if a node is the first node or not.  Either a external pointer, list, points the first node or  A header node is placed as the first node of the circular list.  The header node can be separated from the others by either heaving a sentinel value as the info part or having a dedicated flag variable to specify if the node is a header node or not.
  • 39. REFERENCES  An introduction to Datastructure with application by jean Trembley and sorrenson  Data structures by schaums and series –seymour lipschutz  http://en.wikipedia.org/wiki/Book:Data_structures  http://www.amazon.com/Data-Structures-Algorithms  http://www.amazon.in/Data-Structures-Algorithms-Made- Easy/dp/0615459811/  http://www.amazon.in/Data-Structures-SIE-Seymour-Lipschutz/dp  List of images 1) http://whttp://www.amazon.in/Data-Structures-SIE-Seymour- Lipschutz/dq 2) ww.amazon.in/Data-Structures-linkedlist 3) ww.amazon.in/Data-Structures-linkedlist 4) ww.amazon.in/Data-Structures-linkedlist 5) ww.amazon.in/Data-Structures-linkedlist 6) ww.amazon.in/Data-Structures-doubly linkedlist