Data structure is a special way of organizing and storing data in the computer memory so that data can be accessed more efficiently. It is indispensable for the proper functioning of many computer algorithms. This book discusses Data Structures and Algorithms, laying emphasis on the concepts and covering the syllabus of B.E., B.Tech., B.Sc., BCA and MCA courses offered in nearly all Indian Universities.

Spread across 14 chapters, the book focuses on both theory and practical aspects of the subject with illustrative examples and academic rigor. It provides comprehensive coverage of all necessary algorithms and their implementations using both C and Python within a single book.

**Chandan Banerjee** is a Ph.D. in Engineering. He is Head of the Department and Professor, Department of IT, Netaji Subhash Engineering College (MAKAUT-WB), Kolkata, India.

**Atanu Das** is a Ph.D. in Engineering. He is Head, Department of MCA, Netaji Subhash Engineering College (MAKAUT-WB), Kolkata, India. Earlier, he was Head, Department of CSE, in the same college.

*List of Algorithms and Pseudocodes
List of C Programs
List of Python Programs
Preface
About the Authors*

Chapter 1: Introduction to Data Structures

1.1 Introduction

1.2 Data Types

1.3 Dynamic Memory Allocation

1.4 Classification of Data Structures

1.5 Operations on Data Structures

1.6 Algorithms and Data Structures

1.7 Choosing Appropriate Data Structures

1.8 File Organization

1.9 Data-related Other Subjects

1.10 C and Python for Program Development

1.11 Programming Paradigms in Data Structure

Review Questions

Case Studies

2.1 Introduction

2.2 Features of Python

2.3 Advantages of Python

2.4 String and Variables

2.5 User Input

2.6 Python Operators

2.7 Lists

2.8 Sets

2.9 Tuples

2.10 Dictionaries

2.11 Conditional Statements (if, else, elif)

2.12 Iteration Loops (while and for)

2.13 Loop Control Statements (break, continue, pass)

2.14 Functions

2.15 Modules

2.16 Packages

2.17 Files

2.18 Exceptions

2.19 Classes and Objects

2.20 Functional Programming in Python

2.21 Numpy Array in Python

2.22 Series and DataFrames in Pandas

Review Questions

Case Studies

Lab Exercises

3.1 Introduction

3.2 Complexity of Algorithms

3.3 Asymptotic Notations

Review Questions

Case Studies

4.1 Introduction

4.2 Array Operations Using Static Memory Allocation

4.3 Array Operations Using Dynamic Memory Allocation

4.4 Applications of Array Using Static Memory Allocations

4.5 Applications of Array Using Dynamic Memory Allocations

4.6 Representation of 2D Arrays in Computer Memory

Review Questions

Case Studies

Lab Exercises

5.1 Introduction

5.2 Classification of Linked Lists

5.3 Operations on Singly Linked List

5.4 Operations on Circular Linked List

5.5 Operations on Doubly Linked List

5.6 Traversing in Linked List

5.7 Memory Allocation and Garbage Collection

5.8 Sparse Matrix Representation Using Array and Linked List

5.9 Polynomials Representation Using Linked List

Review Questions

Case Studies

Lab Exercises

6.1 Introduction

6.2 Design and Implementation of Stack

6.3 Applications of Stack

Review Questions

Case Studies

Lab Exercises

7.1 Introduction

7.2 Design and Implementation of Queue

7.3 Double-ended Queue or Deque

7.4 Priority Queue

7.5 Implement Queue Using Two Stacks with the Help of Arrays

Review Questions

Case Studies

Lab Exercises

8.1 Introduction

8.2 GCD of Two Numbers Using Recursion

8.3 Factorial of a Number Using Recursion

8.4 Fibonacci Series Using Recursion

8.5 Ackermann Function Using Recursion

8.6 Pascal’s Triangle Representation Using Recursion

8.7 Solving the Tower of Hanoi Problem Using Recursion

8.8 Sorting a Stack Using Recursion

8.9 N-Queens Problem Using Recursion

8.10 Dynamic Programming and Memoization

8.11 Some Solved Examples of Recursion

Review Questions

Case Studies

Lab Exercises

9.1 Introduction

9.2 Characteristics of Binary Trees

9.3 Binary Tree Traversal Algorithms

9.4 Construction of a Binary Tree Using Tree Traversal

9.5 Threaded Binary Tree

9.6 Binary Search Tree (BST)

9.7 AVL Tree or Height-balanced Tree

9.8 B Tree (Balanced Tree)

Review Questions

Case Studies

Lab Exercises

10.1 Introduction

10.2 Representation of Graph

10.3 Applications of Graph

10.4 Traversing a Graph

10.5 Spanning Tree

10.6 Dijkstra’s Algorithm for Shortest-path Evaluation

10.7 Grid Path Problem

10.8 Longest Common Subsequence (LCS)

Review Questions

Case Studies

Lab Exercises

11.1 Introduction

11.2 Bubble Sort

11.3 Insertion Sort

11.4 Selection Sort

11.5 Quick Sort

11.6 Merge Sort

11.7 Heap Sort

11.8 Radix Sort

11.9 Comparison of Time Complexity of Sorting Methods

Review Questions

Case Studies

Lab Exercises

12.1 Introduction

12.2 Linear Search

12.3 Binary Search

12.4 Interpolation Search

Review Questions

Case Studies

Lab Exercises

13.1 Introduction

13.2 Popular Hashing Methods

13.3 Collision Resolution Techniques

13.4 Implementations of Collision Resolution Techniques

13.5 Analysis of Hashing Techniques and Load Factor

13.6 Rehashing Technique

Review Questions

Case Studies

Lab Exercises

14.1 Introduction

14.2 Classification of File Organizations

14.3 File Operations

14.4 Importance of File Organization

14.5 File Read–Write–Append Operations with C and Python

14.6 File Organization and Operating System

Review Questions

Case Studies

Lab Exercises