You are on page 1of 8

J.N.

N INSTITUTE OF
ENGINEERING
Department of Computer Science And Engineering

AD8251 – Data Structure Design, 2nd Semester

By
Mr. B.JAYARAM
UNIT 2

List ADT – array-based implementations – linked list


implementations – singly linked lists – circularly linked lists –
doubly linked lists – applications of lists – Stack ADT – Queue
ADT – double ended queues
List ADT

 Textbook: Data structures and algorithm using python –


Rance D Naise
 Chapter -6 From page 155
Basic Class for List ADT

class ListNode :
def __init__( self, data ) :
self.data = data

Several instances can be created for list.

 a = ListNode( 11 )
 b = ListNode( 52 )
 c = ListNode( 18 )
Basic Class for List ADT

 To add additional data member we can use


Basic Class for List ADT
Basic Class for List ADT
Predict the output.

 Print(a.data)
 Print(a..next.data)
 Print(a.next.next.data)

You might also like