





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
is an important concept in object-oriented programming. ADTs give us a way to describe and use abstract objects in programming. With ADTs, we can define new data types and methods to manipulate them. Some examples of ADTs include data structures such as stacks, queues, linked lists, and binary search trees. ADTs are an important tool for creating highly reusable programs that are easy to maintain and develop.
Typology: Schemes and Mind Maps
1 / 37
This page cannot be seen from the preview
Don't miss anything!






























LECTURE 02: LINKED LIST LECTURE 02: LINKED LIST
1
Describe List structures
Describe self-referential structures
Explain types of linked lists
Singly Linked Lists
Doubly Linked Lists
Circular Lists
Lists in java.util
Reading at home
Describe List structures
Describe self-referential structures
Explain types of linked lists
Singly Linked Lists
Doubly Linked Lists
Circular Lists
Lists in java.util
Reading at home
It’s difficult to specify a single list Abstract Data Type (ADT) that covers
both arrays and linked lists
One issue is the representation of position
Array position is represented by integer
Linked list position is represented by pointer
In case of an array with n elements, a “position” is simply an integer in
the range from 0 to n-1.
In linked list, a position can be a pointer to one of the nodes in the list,
but there are some subtleties involved (see later)
It’s difficult to specify a single list Abstract Data Type (ADT) that covers
both arrays and linked lists
One issue is the representation of position
Array position is represented by integer
Linked list position is represented by pointer
In case of an array with n elements, a “position” is simply an integer in
the range from 0 to n-1.
In linked list, a position can be a pointer to one of the nodes in the list,
but there are some subtleties involved (see later)
getFirst()
getLast()
getNext(p)
getPrev(p)
get(p)
set(p, x)
insert(p, x)
getFirst()
getLast()
getNext(p)
getPrev(p)
get(p)
set(p, x)
insert(p, x)
remove(p)
removeFirst()
removeLast()
removeNext(p)
removePrev(p)
find(x)
size()
remove(p)
removeFirst()
removeLast()
removeNext(p)
removePrev(p)
find(x)
size()
Employee
String name;
int age;
DataNode
Employee
info;
DataNode
next;
Linked List
Tree
A collection of nodes storing data and links to other nodes
A linear DS composed of nodes
Types of linked lists
A collection of nodes storing data and links to other nodes
A linear DS composed of nodes
Types of linked lists
Its node contains two data fields: info and next.
Its node contains two data fields: info and next.
12 99 37 null
head tail
Implementing java code for
Implementing java code for
In doubly linked list, each node has two
reference fields
one to the successor and
one to the predecessor
In doubly linked list, each node has two
reference fields
one to the successor and
one to the predecessor