0% found this document useful (0 votes)
179 views3 pages

Data Structures and Algorithms 2024

assignment
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
179 views3 pages

Data Structures and Algorithms 2024

assignment
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DATA STRUCTURES AND ALGORITHMS

Name: ABDIRIZAK AHMED KOSAR


REG.No: sct221-c004-0121/2023

(a): Abstract Data Types (ADTs) are theoretical models that define a set of operations without
specifying the implementation details. Examples include:
1. Stack: A data structure that follows the Last-In-First-Out (LIFO) principle. It supports
operations like push (add element), pop (remove element), and peek (view the top
element).
2. Queue: A data structure that follows the First-In-First-Out (FIFO) principle. It supports
operations like enqueue (add element), dequeue (remove element), and peek (view the
front element).
3. Binary Tree: A hierarchical data structure composed of nodes, each containing a value
and two references to other nodes (left child and right child).
(b): Most data structures are accompanied by algorithms tailored to manipulate the data they
store efficiently. For instance:
1. Searching Algorithms: Binary search for sorted arrays, linear search for unsorted arrays.
2. Sorting Algorithms: Quick sort, merge sort, bubble sort.
3. Traversal Algorithms: Depth-First Search (DFS) for trees and graphs, Breadth-First Search
(BFS) for graphs.

(c): Explain the following operations on a list using appropriate diagrams :


1. Insertion: Adding an element into a list at a specified position.
2. Deletion: Removing an element from a list at a specified position.

(d): Explain the following array features:


Subscript: A numerical index used to access individual elements within an array. Elements:
Individual data items stored within an array. Array Processing: Manipulating array elements
through operations like sorting, searching, or updating.

(e): Discuss last-in-first-out (LIFO) as used in a stack data structure with the aid of a diagram. [7
marks]:

LIFO principle means that the last element added to the stack is the first one to be removed.
This behavior can be illustrated with a diagram showing elements stacked vertically, with the
most recently added element at the top. Operations like push (adding an element) and pop
(removing an element) follow this principle, ensuring consistent ordering.

References
1. Goodrich, Michael T., et al. "Data Structures and Algorithms in Java." John Wiley &
Sons, 2020.
2. Cormen, Thomas H., et al. "Introduction to Algorithms." MIT Press, 2009.
3. Weiss, Mark Allen. "Data Structures and Algorithm Analysis in Java." Pearson
Education, 2014.
4. Sedgewick, Robert, and Kevin Wayne. "Algorithms." Addison-Wesley, 2011.
5. Carrano, Frank M., and Timothy Henry. "Data Abstraction & Problem Solving with C++:
Walls and Mirrors." Pearson, 2016.

You might also like