












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
Material Type: Notes; Professor: Karki; Class: ADV DATA STRUCTURES; Subject: Computer Science; University: Louisiana State University; Term: Unknown 1989;
Typology: Study notes
1 / 20
This page cannot be seen from the preview
Don't miss anything!













Notion of algorithm Fundamentals of algorithmic problem solving Important problem types Analysis of algorithmic efficiency Non-recursive algorithms Recursive algorithms
Types
Linked Lists A linked list is an ordered collection of data in which each element contains the location of the next element. Each element (item) called node contains two parts: data and link Link contains a pointer variable that identifies the first element in the list. Nodes are called self-referential structures. Each instance of the structure contains a pointer to another instance of the same structural type. Unlike arrays, data can be easily inserted and deleted in the linked list. But the search becomes sequential because the elements are no longer physically sequenced. Linked list ADT consists of the data structure and all operations that manipulate the data.
plist data link data link data link data link data null
Linked Lists: Data Structure A head node contains metadata about the list such as count, a head pointer to the first node, and a rear pointer to the last node. Data node contains the data type which depends entirely on the application and a pointer to another data structure of its own type. count pos head data link list count
Linked List Using JAVA
public class IntNode { private int data private IntNode link }
IntNode head IntNode tail
public IntNode(int initialData, IntNode initialLink) { data = initialData link = initialLink }
Get and set the data and link Add a new node Remove a node List length Traverse a linked list Search a node Copy a linked list …………..
Complex Linked List Structures
The last node’s link always point to the first node of the last.
Each node has a pointer to both its successor and its predecessor.
List has two or more logical key sequences Data can be ordered choronologically and also by the president’s name or by his first wife’s name.
Stacks: Data Structure Head node contains metadata about the stack such as count, and a pointer to the top of the stack Data node looks like a typical linked list data node. count top data next stack count
Stack Algorithms
Queues A queue is a linear list in which data can be inserted at one end, called the rear, and deleted from the other end, called the front. It is a First In, First Out (FIFO) data structure. Basic queue operations: Enqueue: inserts an element at the rear of the queue Dequeue: deletes an element at the front of the queue Queue front: examines the element at the front of the queue Queue rear: examines the element at the rear of the queue. Queue-linked list implementation Usually implemented as a linked list in dynamic memory. head X Conceptual view Physical view data nodes front rear front rear
Queues: Data Structure Head node contains metadata about the stack such as count, and two pointers to the front and rear of the queue Data node looks like a typical linked list data node. front count rear data next queue front
Queue Applications
Deals with the performance of queues Two factors that most affect the performance of queues are the arrival rate and the service time
Processing customer requests, jobs and orders CPU scheduling: processing jobs waiting for execution.
Stack and Queue ADT