Data Structures - Ebook PDF All Chapters Instant Download
Data Structures - Ebook PDF All Chapters Instant Download
com
https://ebooksecure.com/download/data-structures-
ebook-pdf/
https://ebooksecure.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-data-structures-3rd-edition/
ebooksecure.com
https://ebooksecure.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-data-structures-4th-edition/
ebooksecure.com
https://ebooksecure.com/product/ebook-pdf-data-structures-and-
abstractions-with-java-4th-edition/
ebooksecure.com
https://ebooksecure.com/product/ebook-pdf-developing-the-
curriculum-9th-edition-by-william-r-gordon-ii/
ebooksecure.com
(eBook PDF) International Relations, Brief Edition 7th
Edition
https://ebooksecure.com/product/ebook-pdf-international-relations-
brief-edition-7th-edition/
ebooksecure.com
https://ebooksecure.com/product/ebook-pdf-introductory-statistics-
exploring-the-world-through-data-2nd/
ebooksecure.com
https://ebooksecure.com/download/affine-arithmetic-based-methods-for-
uncertain-power-system-analysis-ebook-pdf/
ebooksecure.com
https://ebooksecure.com/product/ebook-pdf-finance-applications-and-
theory-5th-edition-by-marcia-cornett/
ebooksecure.com
https://ebooksecure.com/download/corporate-finance-6th-global-edition-
ebook-pdf/
ebooksecure.com
(eBook PDF) Precalculus with Limits 4th Edition
https://ebooksecure.com/product/ebook-pdf-precalculus-with-limits-4th-
edition/
ebooksecure.com
Data Structures
About the Author
E Balagurusamy, former Vice Chancellor, Anna University, Chennai and
Member, Union Public Service Commission, New Delhi, is currently the
Chairman of EBG Foundation, Coimbatore. He is a teacher, trainer, and
consultant in the fields of Information Technology and Management. He holds
an ME (Hons) in Electrical Engineering and PhD in Systems Engineering
from the Indian Institute of Technology, Roorkee. His areas of interest include
Object-Oriented Software Engineering, E-Governance, Technology Management,
Business Process Re-engineering, and Total Quality Management.
A prolific writer, Dr Balagurusamy has authored a large number of research
papers and several books.
A recipient of numerous honors and awards, Dr Balagurusamy has been listed in the Directory of
Who’s Who of Intellectuals and in the Directory of Distinguished Leaders in Education.
Data Structures
E Balagurusamy
Chairman
EBG Foundation
Coimbatore
Print-Book Edition
ISBN (13): 978-93-5316-182-8
ISBN (10): 93-5316-182-7
E-Book Edition
ISBN (13): 978-93-5316-183-5
ISBN (10): 93-5316-183-5
Information contained in this work has been obtained by McGraw Hill Education (India), from sources believed to be reliable.
However, neither McGraw Hill Education (India) nor its authors guarantee the accuracy or completeness of any information published
herein, and neither McGraw Hill Education (India) nor its authors shall be responsible for any errors, omissions, or damages arising
out of use of this information. This work is published with the understanding that McGraw Hill Education (India) and its authors are
supplying information but are not attempting to render engineering or other professional services. If such services are required, the
assistance of an appropriate professional should be sought.
Typeset at APS Compugraphics, 4G, PKT 2, Mayur Vihar Phase-III, Delhi 96, and printed at
Acknowledgements
I would like to thank the following reviewers for their suggestions in improving the script:
Dr. K. Sasi Kala Rani Hindusthan Institute of Technology, Coimbatore
Shashank Dwivedi UCER, Allahabad, Uttar Pradesh
Rajiv Pandey Amity University Lucknow Campus, Lucknow, Uttar Pradesh
Mahua Banerjee Xavier Institute of Social Service, Ranchi, Jharkhand
Sameer Bhave Indore Professional Studies Academy, Indore, Madhya Pradesh
D Lakshmi, Adithya Institute of Technology, Coimbatore, Tamil Nadu
A Sharada G Narayanamma Institute of Technology and Science, Hyderabad,
Andhra Pradesh
Sincere thanks to the editorial team of McGraw Hill Education (India) for their support and cooperation.
Publisher’s Note
Remember to write to us. We look forward to receiving your feedback, comments, and ideas to enhance
the quality of this book. You can reach us at info.india@mheducation.com. Please mention the title and
authors’ name as the subject. In case you spot piracy of this book, please do let us know.
vi Preface
Contents
Preface v
Roadmap to the Syllabus xiii
2. Arrays 2.1
2.1 Introduction 2.2
2.2 Types of Arrays 2.2
2.3 Representation of One-Dimensional Array in Memory 2.3
2.4 Array Traversal 2.3
2.5 Insertion and Deletion 2.5
2.5.1 Insertion 2.5
2.5.2 Deletion 2.8
2.6 Sorting and Searching 2.10
2.6.1 Sorting 2.10
2.6.2 Searching 2.13
2.8 Realizing Matrices using Two-Dimensional Arrays 2.16
2.9 Matrix Operations 2.18
2.9.1 Addition 2.18
2.9.2 Subtraction 2.21
2.9.3 Multiplication 2.21
2.9.4 Transpose 2.24
Solved Problems 2.26
Summary 2.27
Key Terms 2.27
Multiple-Choice Questions 2.28
Review Questions 2.29
Programming Exercises 2.29
viii Contents
Multiple-Choice Questions 3.34
Review Questions 3.35
Programming Exercises 3.35
4. Stacks 4.1
4.1 Introduction 4.2
4.2 Stacks 4.2
4.2.1 Stack Representation in Memory 4.2
4.2.2 Arrays vs. Stacks 4.3
4.3 Stack Operations 4.3
4.3.1 Push 4.4
4.3.2 Pop 4.4
4.3.3 An Example of Stack Operations 4.5
4.4 Stack Implementation 4.5
4.4.1 Array Implementation of Stacks 4.5
4.4.2 Linked Implementation of Stacks 4.11
Solved Problems 4.16
Summary 4.19
Key Terms 4.19
Multiple-Choice Questions 4.20
Review Questions 4.21
Programming Exercises 4.22
5. Queues 5.1
5.1 Introduction 5.2
5.2 Queues—Basic Concept 5.2
5.2.1 Logical Representation of Queues 5.3
5.3 Queue Operations 5.4
5.4 Queue Implementation 5.6
5.4.1 Array Implementation of Queues 5.6
5.4.2 Linked Implementation of Queues 5.12
5.5 Circular Queues 5.17
5.6 Priority Queues 5.25
5.7 Double-Ended Queues 5.31
Solved Problems 5.34
Summary 5.37
Key Terms 5.37
Contents ix
Multiple-Choice Questions 5.38
Review Questions 5.39
Programming Exercises 5.39
6. Trees 6.1
6.1 Introduction 6.2
6.2 Basic Concept 6.2
6.2.1 Tree Terminology 6.2
6.3 Binary Tree 6.3
6.3.1 Binary Tree Concepts 6.4
6.4 Binary Tree Representation 6.5
6.4.1 Array Representation 6.5
6.4.2 Linked Representation 6.6
6.5 Binary Tree traversal 6.10
6.6 Binary Search Tree 6.17
6.7 Tree Variants 6.24
6.7.1 Expression Trees 6.25
6.7.2 Threaded Binary Trees 6.26
6.7.3 Balanced Trees 6.27
6.7.4 Splay Trees 6.30
6.7.5 m-way Trees 6.31
Summary 6.33
Multiple-Choice Questions 6.34
Key Terms 6.34
Review Questions 6.35
Programming Exercises 6.35
7. Graphs 7.1
7.1 Introduction 7.2
7.2 Basic Concept 7.2
7.3 Graph Terminology 7.3
7.4 Graph Implementation 7.4
7.4.1 Implementing Graphs using Adjacency Matrix 7.4
7.4.2 Implementing Graphs using Path Matrix 7.6
7.4.3 Implementing Graphs using Adjacency List 7.8
x Contents
Visit https://testbankfan.com
now to explore a rich
collection of testbank or
solution manual and enjoy
exciting offers!
7.5 Shortest Path Algorithm 7.11
7.6 Graph Traversal 7.15
7.6.1 Breadth First Search 7.15
7.6.2 Depth First Search 7.16
Summary 7.17
Key Terms 7.17
Multiple-Choice Questions 7.17
Review Questions 7.18
Programming Exercises 7.18
Contents xi
Roadmap to the Syllabus
Data Structures
Semester III
Chapter 4: Stacks
GO TO
Chapter 5: Queues
GO TO Chapter 6: Trees
Unit-IV: NON LINEAR DATA STRUCTURES – GRAPHS
Definition – Representation of Graph – Types of graph – Breadth-first traversal – Depth-first
traversal – Topological Sort – Bi-connectivity – Cut vertex – Euler circuits – Applications of graphs.
GO TO Chapter 7: Graphs
CHAPTERS
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.