0% found this document useful (0 votes)
31 views22 pages

Data Structures and Algorithms Implementation Through C 1st Edition Dr. Brijesh Bakariya. Download

The document provides information about the book 'Data Structures and Algorithms Implementation through C' by Dr. Brijesh Bakariya, which covers fundamental concepts of data structures and algorithms. It includes a detailed table of contents outlining various topics such as algorithms, data structures, stacks, queues, trees, and graphs, aimed at students in computer science fields. Additionally, it mentions other related books and offers download links for further reading.

Uploaded by

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

Data Structures and Algorithms Implementation Through C 1st Edition Dr. Brijesh Bakariya. Download

The document provides information about the book 'Data Structures and Algorithms Implementation through C' by Dr. Brijesh Bakariya, which covers fundamental concepts of data structures and algorithms. It includes a detailed table of contents outlining various topics such as algorithms, data structures, stacks, queues, trees, and graphs, aimed at students in computer science fields. Additionally, it mentions other related books and offers download links for further reading.

Uploaded by

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

Data Structures and Algorithms Implementation

through C 1st Edition Dr. Brijesh Bakariya.


download

https://ebookmeta.com/product/data-structures-and-algorithms-
implementation-through-c-1st-edition-dr-brijesh-bakariya/

Download full version ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Data Structures and Algorithms - Lecture Notes from


IISc 1st Edition Dr. Y. Narahari

https://ebookmeta.com/product/data-structures-and-algorithms-
lecture-notes-from-iisc-1st-edition-dr-y-narahari/

Data Structures Through C++ (4th Ed.) Yashavant


Kanetkar

https://ebookmeta.com/product/data-structures-through-c-4th-ed-
yashavant-kanetkar/

Data Structures Through C 3rd Ed 1st Edition Yashavant


Kanetkar

https://ebookmeta.com/product/data-structures-through-c-3rd-
ed-1st-edition-yashavant-kanetkar/

A Textbook of Data Structures and Algorithms, Volume 3


: Mastering Advanced Data Structures and Algorithm
Design Strategies 2nd Edition G. A. Vijayalakshmi Pai

https://ebookmeta.com/product/a-textbook-of-data-structures-and-
algorithms-volume-3-mastering-advanced-data-structures-and-
algorithm-design-strategies-2nd-edition-g-a-vijayalakshmi-pai/
When Words Grow Fangs 1st Edition Chase Connor

https://ebookmeta.com/product/when-words-grow-fangs-1st-edition-
chase-connor/

Europe s Hybrid Threats What Kinds of Power Does the EU


Need in the 21st Century 1st Edition Giray Sadik

https://ebookmeta.com/product/europe-s-hybrid-threats-what-kinds-
of-power-does-the-eu-need-in-the-21st-century-1st-edition-giray-
sadik/

Fundamentals of Aeroacoustics with Applications to


Aeropropulsion Systems 1st Edition Xiaofeng Sun

https://ebookmeta.com/product/fundamentals-of-aeroacoustics-with-
applications-to-aeropropulsion-systems-1st-edition-xiaofeng-sun/

Cinderella Naomi Mcmillan

https://ebookmeta.com/product/cinderella-naomi-mcmillan-2/

An Unexpected Christmas Love 1st Edition Faith Quinn

https://ebookmeta.com/product/an-unexpected-christmas-love-1st-
edition-faith-quinn/
Understanding Money Learn to handle investments
finances successfully invest intelligently instead of
saving stock trading for beginners ETF index funds win
with assets 2nd Edition Simone Janson
https://ebookmeta.com/product/understanding-money-learn-to-
handle-investments-finances-successfully-invest-intelligently-
instead-of-saving-stock-trading-for-beginners-etf-index-funds-
win-with-assets-2nd-edition-simone-janson/
DATA STRUCTURES AND
ALGORITHMS
IMPLEMENTATION
THROUGH C

By
Dr. Brijesh Bakariya
FIRST EDITION 2020
Copyright © BPB Publications, INDIA
ISBN: 978-93-8655-194-8

All Rights Reserved. No part of this publication can be stored in a retrieval system
or reproduced in any form or by any means without the prior written permission of
the publishers.

LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY


The Author and Publisher of this book have tried their best to ensure that the
programmes, procedures and functions described in the book are correct.
However, the author and the publishers make no warranty of any kind, expressed
or implied, with regard to these programmes or the documentation contained in
the book. The author and publisher shall not be liable in any event of any
damages, incidental or consequential, in connection with, or arising out of the
furnishing, performance or use of these programmes, procedures and functions.
Product name mentioned are used for identification purposes only and may be
trademarks of their respective companies.

All trademarks referred to in the book are acknowledged as properties of their


respective owners.

Distributors:
BPB PUBLICATIONS
20, Ansari Road, Darya Ganj
New Delhi-110002
Ph: 23254990/23254991

BPB BOOK CENTRE


376 Old Lajpat Rai Market,
Delhi-110006
Ph: 23861747
MICRO MEDIA
Shop No. 5, Mahendra Chambers,
150 DN Rd. Next to Capital Cinema,
V.T. (C.S.T.) Station, MUMBAI-400 001
Ph: 22078296/22078297

DECCAN AGENCIES
4-3-329, Bank Street,
Hyderabad-500195
Ph: 24756967/24756400

Published by Manish Jain for BPB Publications, 20, Ansari Road, Darya Ganj, New
Delhi-110002 and Printed by Repro India Pvt Ltd, Mumbai
Dedicated To
This book is dedicated to my parents (Mr. Gurubaksh
Bakariya and
Mrs. Sugna Bakariya), my wife (Mrs. Surekha Bakariya) and
my lovely daughter (Misthi Bakariya) whoxybever supported
me in all respects of life and career.
This journey of mine proved to be a boon by
following their words and experiences.
“All Birds find shelter during a rain.
But Eagle avoids rain by flying above the Clouds.”
A.P.J Abdul Kalam
Acknowledgement
It is my pleasure to take this opportunity to thank all those who
helped me directly or indirectly in the preparation of this book.
I would like to place on record and acknowledge the works of all
those great authors whose work I have referred in the preparation of
this book.
I would like to thanks to my wife Mrs. Surekha Bakariya and loving
daughter Misthi (Cherry) whose precious and cheerful time I pilfered
time to time to fulfill the task in time.
I would extend my gratitude to the BPB Publications for bringing out
the book in its present form.
Any suggestions for improving the contents would be warmly
appreciated.

Dr. Brijesh Bakariya


Preface
This is an era of computer science and we emphasize on the
fundamental concepts of data structures which are more efficient
from time and space point of view. This book clears detail concepts
about various data structure and algorithms such as stacks, queues,
linked lists, trees and graphs. This book is also encouraging about to
construct novel data structures which are more efficient to existing
data structures.
This book is useful for efficient organization of data due to this
various operations can be performs on data. It is also useful for
constructing and analyzing an algorithm of data structures. This
book is written for DCA, PGDCA, B.Tech. /B.E., BCA, BSc M.Tech. /
M.E., MCA, MSc students. The book is organized in 14 chapters and
brief content is as follows:
Chapter 1 provides the basics of algorithms and their flow charts.
Chapter 2 describes the concept about algorithm analysis and
complexity of an algorithm.
Chapter 3 introduces a data structure and brief description about
various data structures.
Chapter 4 provides the basics concepts of functions and recursions.
Chapter 5 & 6 provides the basics of arrays, pointers and strings.
Chapter 7 explains the stack data structure and their
implementation.
Chapter 8 introduces queue data structure and their types.
Chapter 9 explains linked lists and its various types with
implementation.
Chapter 10 covers tree data structure its various types with
examples.
Chapter 11 covers graph data structures contain various real-life
problems.
Chapter 12 & 13 covers searching and sorting of data.
Chapter 14 cover detail description about hashing, its various types
and techniques with examples.
All the basic concepts have been discussed in above chapters. For
practice session students may follow chapter wise review exercises.
Although the content has been supervised by many senior
educationists, there may be some shortcomings. As human is prone
to errors, authors wish to forgive the mistakes and we welcome your
suggestions and criticism if any! The authors has try his best to
incorporate such valuable suggestions in the subsequent editions of
this book.
Table of Content
Chapter 1: Algorithms and Flowcharts
1.1 Introduction of Algorithm
1.2 What is an algorithm?
1.3 Flowcharts
1.3.1 Reason to Use Flowcharts
1.4 Advantages
1.5 Symbols Used for Making Flowcharts
1.6 Pseudocode
1.7 Difference between Algorithm and Pseudocode

Chapter 2: Algorithm Analysis


2.1 Introduction
2.2 Why to Study an Algorithm?
2.3 Definition of an Algorithm
2.4 Steps to Construct an Algorithm
2.5 Analysis of an Algorithm
2.5.1 Apriori Analysis
2.5.2 Aposteriori Analysis
2.6 Complexity of an Algorithm
2.6.1 Time Complexity
2.6.2 Space Complexity
2.7 Asymptotic Notation
2.7.1 Properties of Asymptotic Notation

Chapter 3: Introduction to Data Structure


3.1 Introduction
3.2 Definition
3.3 Classification of Data Structure
3.3.1 Primitive Data Structure
3.3.2 Non Primitive Data Structure
3.4 Array
3.4.1 Declaration and Initialization of an Array
3.5 Stacks
3.6 Queue
3.7 Linked List
3.8 Tree
3.9 Graph
3.10 Memory Allocation in C
3.10.1 Static Allocation
3.10.2 Dynamic Allocation
3.10.2.1 The malloc() function
3.10.2.2 The calloc () Function
3.10.2.3 The free() Function
3.10.2.4 The realloc() Function
3.11 Functions of Data Structure

Chapter 4: Function and Recursion


4.1 Introduction
4.2 Definition
4.3 Types of Functions
4.3.1 Predefined Function
4.3.2 User Defined Function
4.4 Function Prototype
4.5 Introduction of Recursion
4.5.1 Definition
4.5.2 Types of Recursion
4.5.2.1 Direct Recursion
4.5.2.2 Indirect Recursion
4.6 Fundamental Need of Recursion
4.7 Iteration and Recursion
4.8 Program for Function and Recursion

Chapter 5: Arrays and Pointers


5.1 Introduction to Arrays
5.2 Definition
5.3 One Dimensional Array
5.3.1 Initialization of One Dimensional Array
5.3.2 Accessing an Element from One Directional Array
5.3.3 Array Implementation in Memory
5.4 Process of Deleting an Element from an Array
5.5 Merging of Two Arrays
5.6 Multi Dimensional Arrays
5.6.1 Initialization of two-dimensional array
5.6.2 Accessing of Element in Two Dimensional Array
5.7 Pointer
5.8 Pointer to Structure

Chapter 6: Strings
6.1 Introduction to Strings
6.2 Definition
6.3 Library Functions of Strings

Chapter 7: Stack
7.1 Introduction to Stack
7.2 Definition
7.3 Stack Implementation
7.4 Operations of Stack
7.5 Applications of Stack
7.6 Programs for Stacks
7.7 Multiple Stacks

Chapter 8: Queues
8.1 Introduction to Queue
8.2 Definition
8.3 Queue Implementation
8.4 Circular Queue
8.4.1 Some Important Points about Circular Queue
8.4.2 Insertion in Circular Queue
8.4.3 Deletion in Circular Queue
8.5 De-queue
8.6 Priority Queue
Chapter 9: Linked Lists
9.1 Introduction
9.2 Terminology
9.3 Representation of Linked List
9.4 Operations of Linked List
9.5 Types of Linked List
9.6 Singly Linked List
9.7 Program for Implementing Linked List
9.8 Circular Linked List
9.9 Doubly Linked List
9.10 Program for Implementing Doubly Linked List
9.11 Circular Doubly Linked List
9.12 Addition of Two Polynomials
9.13 Program for Implementing Circular Doubly Linked List

Chapter 10: Trees


10.1 Introduction to Tree
10.2 Tree Terminology
10.3 Binary Tree
10.3.1 Binary Tree Representation using Array
10.3.2 Binary Tree Representation using Linked List
10.4 Dynamic Implementation of Binary Search Tree
10.5 Strictly Binary Tree
10.6 Complete Binary Tree
10.7 Tree Traversal
10.7.1 In-order Traversal
10.7.2 Pre-order Traversal
10.7.3 Post-order Traversal
10.8 Recursive Code for Preorder, Inorder and Postorder
Traversal
10.9 Tree Construction
10.10 Binary Search Tree
10.11 Expression Tree
10.12 Threaded Binary Tree
10.12.1 Types of Threaded Binary Trees
10.13 AVL Tree
10.14 Balance Factor
10.15 Insertion in AVL tree
10.16 M-way Tree
10.17 B- Tree
10.18 B+ Tree

Chapter 11: Graph


11.1 Introduction to Graphs
11.2 Basic Terminology of a Graph
11.3 Representation of Graph
11.4 Graph Traversals
11.4.1 DFS (Depth First Search)
11.4.2 BFS (Breadth First Search)
11.5 Spanning Tree
11.5.1 General Properties of Spanning Tree
11.5.2 Application of Spanning Tree
11.6 Minimum Spanning Tree (MST)
11.6.1 Minimum Spanning-Tree Algorithm
11.6.1.1 Kruskal's Algorithm
11.6.1.2 Prim's Algorithm
11.7 Shortest Path
11.7.1 Dijkstra's Algorithm
11.7.2 Bellman Ford's Algorithm

Chapter 12: Searching


12.1 Introduction to Searching
12.2 Types of Searching

Chapter 13: Sorting


13.1 Introduction
13.2 Types of sorting
13.3 Sorting Techniques
13.3.1 Bubble Sort
13.3.2 Selection Sort
13.3.3 Insertion Sort
13.3.4 Quick Sort
13.3.5 Merge Sort
13.3.6 Heap Sort

Chapter 14: Hashing


14.1 Introduction to Hashing
14.2 Direct Address Table
14.3 Hash Function
14.4 Collision
14.4.1 Types of Hash Functions
14.5 Collision Resolution Technique (CRT)
14.6 Perfect Hashing
Another Random Scribd Document
with Unrelated Content
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

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.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.

You might also like