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

2.1 ADSA Lecture-Unit-II-Ch1

Uploaded by

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

2.1 ADSA Lecture-Unit-II-Ch1

Uploaded by

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

Department of Computer Science and Engineering (CSE)

Contents of the Syllabus

UNIT-I (15h)
Introduction to Basic Data Structures: Importance and need of good data structures and algorithms, Introduction
to linear and non-linear data structure and its importance, Algorithms Complexity and Analysis. [3]
Linear and Non –Linear Data Structures : Arrays , Link Lists, Queues , Trees and related algorithms [6]
Advanced Data Structures: AVL Trees (Insertion , Deletion , Searching), Red-Black Trees, B-trees, B+trees,
Heaps. Data structure for disjoint sets, Augmented data structures. [6]

UNIT-II (15h)
Searching and Sorting : Internal and External Sorting algorithms: Linear Search, Binary Search, Bubble Sort,
Selection Sort, Insertion Sort, Shell Sort, Quick Sort, Heap Sort, Merge Sort, Counting Sort, Radix Sort and
analysis of their complexities and Hashing
[4]
Graphs & Algorithms: Representation, Type of Graphs, Depth- and breadth-first traversals, Planar graphs,
isomorphism, graph coloring, covering and partition, Minimum Spanning Tree: Prim’s and Kruskal’s
algorithms. [6]
String Matching Algorithms: Naïve String Matching, Suffix arrays, Suffix trees, Rabin-Karp, Knuth-Morris-
Pratt, Booyer-Moore algorithm [5]

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Contents of the Syllabus

UNIT-III (15h)
Approximation algorithms: Need of approximation algorithms: Introduction to P, NP, NP-Hard and NP-Complete Greedy
Approach, Dynamic Approach, Knapsack, Huffman Coding, TSP, All pair shortest path, Longest Common Subsequence
Problem, Matrix Chain Multiplication. [7]

Randomized algorithms: Introduction, type of randomized algorithms, Quick sort, min cut
[4]

Online Algorithms: Introduction, Online Paging Problem, k-server Problem. Data compression: Huffman’s coding,
BWT, LZW
[4]

Recommended Books:
1. Cormen, Leiserson, Rivest, Stein, “Introduction to Algorithms”, Prentice Hall of India, 3rd edition 2012.
2. Horowitz, Sahni and Rajasekaran, “Fundamental of Computer, Algorithms”, University Press (India),
2nd edition.
3. Aho, Haperoft and Ullman, “The Design and analysis of Computer Algorithms”, Pearson Education
India.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Sorting

• Sorting is a process in which records are arranged in ascending or descending order

Types Of Sorting
• Bubble sort
• Insertion sort
• Selection sort
• Merge sort
• Quick sort
• Heap sort
• Shell sort
• Cycle sort
• Count sort
• Radix Sort

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bubble Sort
• Exchange two adjacent elements if they are out of order. Repeat until array is sorted.
• Example:
Take an array of numbers " 5 1 4 2 8", and sort the array from lowest
number to greatest number using bubble sort. In each step, elements
written in bold are being compared. Three passes will be required;

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Step-by-step example

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Bubble Sort
BUBBLE(DATA, N)
Here DATA is an array with N elements. This algorithm sorts the elements in DATA.
1.Repeat steps 2 and 3 for K = 1 to N – 1
2.Set PTR = 1 [Initialize pass pointer PTR]
3.Repeat while PTR ≤ N – K [Executes pass]
a) If DATA[PTR] > DATA[PTR + 1], then
Interchange DATA[PTR] and DATA[PTR + 1]
[End of If structure]
b) Set PTR = PTR + 1
[End of inner loop]
[End of step 1 outer loop]
4.Exit

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Insertion sort

Insertion sort is a simple sorting algorithm that works the way we sort
playing cards in our hands

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Algorithm

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Selection Sort
• Selection sort is a simple sorting algorithm. This sorting algorithm is an in-place
comparison-based algorithm in which the list is divided into two parts, the
sorted part at the left end and the unsorted part at the right end. Initially, the
sorted part is empty and the unsorted part is the entire list.
• The smallest element is selected from the unsorted array and swapped with the
leftmost element, and that element becomes a part of the sorted array. This
process continues moving unsorted array boundary by one element to the right.
• This algorithm is not suitable for large data sets as its average and worst case
complexities are of Ο(n2), where n is the number of items.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Example

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Algorithm

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Books Recommended

Lipschutz, Seymour, “Data Structures”, Schaum's Outline Series, Tata McGraw


Hill.
Gilberg/Forouzan,” Data Structure with C ,Cengage Learning.
Augenstein,Moshe J , Tanenbaum, Aaron M, “Data Structures using C and C+
+”, Prentice Hall of India.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

References

• Lipschutz, Seymour, “Data Structures”, Schaum's Outline Series, Tata


McGraw Hill.
• Goodrich, Michael T., Tamassia, Roberto, and Mount, David M., “Data
Structures and Algorithms in C++”, Wiley Student Edition.
• “Data Structures and Algorithms for GATE: Solutions to All Previous GATE
Questions Since 1991” by Narasimha Karumanchi
• https://www3.ntu.edu.sg/home/ehchua/programming/cpp/DataStructureAlgorithm.h
tml
• https://www.geeksforgeeks.org/data-structures/
• https://www.prodevelopertutorial.com/searching-algorithm-3-jump-search-explanati
on-and-implementation-in-c-language/
• https://www.prodevelopertutorial.com/ajs-guide-to-data-structures-and-algorithms-t
he-complete-guide-from-beginner-to-expert/

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Thank you

University Institute of Engineering (UIE)

You might also like