0% found this document useful (0 votes)
3 views

Abstract Data Types Group 1

Abstract Data Types (ADTs) define data structures by their behavior rather than implementation, promoting abstraction, encapsulation, and modularity. Common ADTs include stacks, queues, and linked lists, each with specific operations and applications, such as task scheduling and undo mechanisms. Real-world applications of ADTs span various fields, including operating systems, web browsers, and data management.

Uploaded by

chagwenac
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Abstract Data Types Group 1

Abstract Data Types (ADTs) define data structures by their behavior rather than implementation, promoting abstraction, encapsulation, and modularity. Common ADTs include stacks, queues, and linked lists, each with specific operations and applications, such as task scheduling and undo mechanisms. Real-world applications of ADTs span various fields, including operating systems, web browsers, and data management.

Uploaded by

chagwenac
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

ABSTRACT DATA

TYPES
 ABSTRACT DATA TYPES
 Abstract Data Types (ADTs) are fundamental concepts in
computer science that define a data structure in terms of its
behavior (the operations that can be performed on it and the
properties of those operations), rather than its implementation.
 This abstraction allows programmers to think about data structures
at a higher level without worrying about the underlying details.
ADTs are crucial for managing and organizing data efficiently.

 KEY CONCEPTS OF ADTS:


 - Abstraction : ADTs provide a clear interface, abstracting away
the implementation details.
 - Encapsulation : Data and operations are encapsulated in a
single unit.
 - Modularity : ADTs promote modularity, making code easier to
manage and maintain
Common ADTs and Their Implementations

 STACKS
 A stack is a linear data structure that follows LAST IN, FIRST
OUT (LIFO) principle. This means that the last element added to
the stack will be the first one to be removed. It's akin to a stack of
plates: you add (push) a new plate on top and remove (pop) the
topmost one first.

 OPERATIONS :
 - Push : Adds an element to the top of the stack.
 - Pop : Removes the top element from the stack.
 - Peek/Top : Retrieves the top element without removing it.
 - isEmpty : Checks if the stack is empty.
ADVANTAGES OF QUEUE OVER OTHER
ABSTRACT DATA TYPES
 First-In-First-Out (FIFO) Order:
 Queues maintain the order of elements in a FIFO manner, which is
essential for scenarios where the order of processing matters (e.g.,
task scheduling, printing jobs).
 Efficient Insertion and Deletion:
 Insertion (enqueue) and deletion (dequeue) operations in a queue
are typically O(1) time complexity when implemented using linked
lists or circular arrays.
 Fairness in Resource Allocation:
 Queues ensure that the first element added is the first one to be
removed, making them ideal for fair resource allocation (e.g., CPU
scheduling, customer service systems).
 Simplicity:
 Queues are simple to implement and understand, making them a
good choice for problems that require sequential processing.
 APPLICATIONS
 - Function Call Management : In many programming
languages, function calls are managed using a call stack.
 - Expression Evaluation : Stacks are used in evaluating
arithmetic expressions.
 - Undo Mechanisms : Most software applications use
stacks for undo operations.
IMAGE REPRESENTATION OF STACK OPERATIONS
Arrays

 An array is a collection of items stored at contiguous memory


locations. It can store a fixed-size sequential collection of elements of
the same type. Each element can be accessed randomly using
indices.
Applications :

 - Data Storage : Storing multiple items of the same type.


 - Matrix Operations : Used in mathematical and scientific
applications.
 - Lookup Tables : Arrays can be used as lookup tables for efficient
searching.

 Operations :
 - Access : Access an element at a given index.
 - Insertion : Insert an element at a specific position.
 - Deletion : Remove an element from a specific position.
 - Update : Modify an element at a specific index.
IMAGE REPRESENTATION OF AN ARRAY OPERATION
Queues
 A queue is a linear data structure that follows the First In, First Out
(FIFO) principle. The first element added to the queue will be the first
one to be removed. It's similar to a line of people at a ticket counter.

 OPERATIONS :
 - Enqueue : Adds an element to the end of the queue.
 - Dequeue : Removes the element from the front of the queue.
 - Front : Retrieves the front element without removing it.
 - isEmpty : Checks if the queue is empty.
 APPLICATIONS :
 - Scheduling : Managing tasks in an operating system.
 - Buffering : Data buffering in streaming and networking.
 - Breadth-First Search : Used in graph traversal algorithms
IMAGE REPRESENTATION OF BASIC QUEUE
OPERATIONS
ADVANTAGES OF QUEUES OVER OTHER ABSTRACT DATA
TYPES

 First-In-First-Out (FIFO) Order:


 Queues maintain the order of elements in a FIFO manner, which is
essential for scenarios where the order of processing matters (e.g., task
scheduling, printing jobs).
 Efficient Insertion and Deletion:
 Insertion (enqueue) and deletion (dequeue) operations in a queue are
typically O(1) time complexity when implemented using linked lists or
circular arrays.
 Fairness in Resource Allocation:
 Queues ensure that the first element added is the first one to be removed,
making them ideal for fair resource allocation (e.g., CPU scheduling,
customer service systems).
 Simplicity:
 Queues are simple to implement and understand, making them a good
choice for problems that require sequential processing.
Linked List

 A linked list is a sequence of data structures, which are connected


together via links.
 Linked List is a sequence of links which contains items. Each link
contains a connection to another link. Linked list is the second most-
used data structure after array. Following are the important terms to
understand the concept of Linked List.
 Link − Each link of a linked list can store a data called an element.
 Next − Each link of a linked list contains a link to the next link called
Next.
 Linked List − A Linked List contains the connection link to the first
link called First.
LINKED LIST REPRESENTATION

 As per the above illustration, following are the important points to be


considered.
 Linked List contains a link element called first.
 Each link carries a data field(s) and a link field called next.
 Each link is linked with its next link using its next link.
 Last link carries a link as null to mark the end of the list.
 Linked list can be visualized as a chain of nodes, where every node
points to the next node.
 TYPES OF LINKED LISTS

 Simple Linked List − Item navigation is forward only.


 Doubly Linked List − Items can be navigated forward and
backward.
 Circular Linked List − Last item contains link of the first
element as next and the first element has a link to the last
element as previous.

 BASIC OPERATIONS

 Insertion − Adds an element at the beginning of the list.


 Deletion − Deletes an element at the beginning of the list.
 Display − Displays the complete list.
 Search − Searches an element using the given key.
 Delete − Deletes an element using the given key.
Real-World Applications of ADT

 Queues:
 Task Scheduling: Operating systems use queues to manage processes in
a fair manner.
 Printing Jobs: Printers use queues to manage multiple print requests.
 Customer Service: Call centers use queues to handle incoming calls.
 Stacks:
 Undo/Redo Operations: Text editors and software use stacks to
implement undo/redo functionality.
 Browser History: Browsers use stacks to manage the back and forward
navigation of web pages.
 Linked Lists:
 Used in dynamic memory allocation, implementing stacks, queues, and
graphs
Real-World Applications of
ADT .ctd
 Trees:
 Used in file systems, database indexing, and hierarchical data
representation.
 Graphs:
 Used in social networks, GPS navigation, and network routing.

You might also like