SlideShare a Scribd company logo
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
ACKNOWLEDGEMENTS
Before every thing I would like to say thanks to almighty ALLAH for Giving me good
Health and A good chance to Help Some One.
I would like to express my deepest gratitude to my advisor, Sir Balach Bali, for his excellent
guidance, caring, patience, and providing me with an excellent atmosphere for writing this
short book .
I would also like to thank to my Male And Female groups of study they always support me
at every step.
I would like to thank Sarim khan, Jamal afghan, Asif Alizai And Syed M.Asif ,Nirmal
Kumar and Noman Jadoon who as good friends, were always willing to help and give their
best suggestions. It would have been a lonely lab without them. I would also like to thank
my mother and brothers. They were always supporting me and encouraging me with
their best wishes.
About author
Obaid kakar
Obaid kakar is the student of university of Balochistan Quetta Pakistan
He did programming courses form Aptech north Nazimabad Karachi and also did
many programs from Some institutes of Quetta.
This short book of data structure and algorithm with java implementation is gift for
University Of Balochistan.
He is teacher in MIT Muslim Information Technology Quetta.
Table of content
Chapter 1: Overview pages
o Introduction to data structure...............................3
o Introduction to Array...........................................5
o Introduction to link lists ......................................6
o Introduction to Stack ..........................................8
o Introduction to Queue ........................................9
o Introduction to Tree ...........................................9
o Introduction to Graph........................................10
o Data structure operations .................................11
o Algorithm and algorithmic notations...................13
Chapter 2: Array
o Introduction ....................................................17
o Traversing .......................................................19
o Insertion in array..............................................23
o Deletion in array ..............................................31
o Searching techniques ........................................34
o Linear search ...................................................35
o Binary search....................................................37
o Short Summary ................................................40
Chapter 3: Sorting
o Introduction .....................................................43
o Bubble sort........................................................43
o Selection sort.....................................................49
o Insertion sort.................................................... 55
o Merge Sort ......................................................62
o Quick Sort........................................................67
o Time complexity...............................................74
o Short Summary .............................................. 79
Chapter 4: linked list
o Introduction To Linked List............................82
o Singly linked list.............................................83
o Doubly link lists.............................................84
o Insertion Operation and Deletion Operation...86
o Singly Linked List In Detail............................90
o Traversing in link list .....................................90
o Insertion in Detail......................................... 92
o Deletion in Detail......................................... 102
o Summary: Linked List...................................106
Chapter 5: Stack and Queue
o Introduction to stack......................................109
o Basic graphical representation .......................110
o Insertion /push..............................................111
o Deletion /Pop ...............................................113
o arithmetic expression in computer..................117
o From Infix To Prefix and Prefix to Infix ........119
o From Infix To Post Fix and Postfix to infix....121
o Introduction to Queue / Line.......................129
o Insertion in Queue.......................................131
o Deletion in Queue........................................137
o Short Summary............................................144
Chapter 6: Tree And Graph
o Introduction to tree.......................................147
o General Tree ...............................................149
o Binary tree...................................................150
o Complete Binary Tree..................................150
o Binary Search Tree (BST)............................154
o Traversing In BST ......................................157
o Insertion in BST..........................................161
o deletion in BST ..........................................164
o Introduction to Graph.................................171
o Graph and its representations......................173
o Graph Traversal ........................................179
o Depth First Search (DFS)...........................179
o Breadth First Search (BFS) .......................181
o Java Programs Examples Of graphs ...........181
o Short Summary..........................................197
o Summary of all chapters ..........201
Introduction
Chapter 1: overview:
In this chapter you will Learn About the Data Structure and how its works and also
overview of the some data structure like Array, Linked lists, Stack Queue, And Also
Graph And Tree.
Chapter 2: Arrays :
There is full detail about array traversing, insertion deletion with graphical views and also
java programs. And in this chapter you will also learn about how array can be organized
in a memory.
Chapter 3: Sorting Techniques:
In this chapter you will be able to learn about the most use full Sorting technique like
bubble sort, selection sort insertion sort, merge sort and Quick sort with graphical
representation and Java Programs. And also can find here the time complexity of some
algorithms.
Chapter 4: Linked Lists.
In this chapter you will find the detail about the linked lists. And how to traverse a linked
lists and how to do insertion and deletion with the linked lists with graphical and
theoretical explanation and with programs.
Chapter 5: Stack And Queue
In this chapter you find the detail about the stack and Queue how it works and its graphical
representation and java programs of Insertion And Deletion. And this chapter also consists
of some arithmetic Expressions and there conversion in detail.
Chapter 6: Graph And Tree
This chapter consists of the Detail About Tree BST and others and it also consist of Graph
in detail and how to travers and insert and delete a value form graph and tree with java
programs and graphical representation.
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Data structure and algorithm with java implementation by obaid kakar
Reference List
People
Sir Balach Bali
Lecturer
University Of Balochistan
Computer Science
Department
Sir Bashir Marri.
Programming Lecturer
University Of Balochistan
Computer Science
Department
Madam Shafaque Saira Malik
IT Professional
University Of Balochistan
Computer Science Department
Madam Asia Rasheed
Lecturer:
communication Skills ,
Technical report writing
University Of Balochistan
RefrenceBooks
[CLRS] Thomas H. Cormen, Charles
E. Leiserson, Ronald
LRivest, CliffordStein. Introduction to
Algorithms.
McGraw-Hill, 2001.
[Knuth] Donald E. Knuth. The Art of
Computer Programming, Volumes 1-3.
Addison-Wesley Professional, 1998.
[Kishor]
[Robert Lafore]
[Thomas H. Cormen]
S.B. Kishor Data Structures,
Edition 3. Das Ganu Prakashan,
Nagpur, 2008.
Data Structures & Algorithms
in Java by Robert Lafore
Sams © 1998,
Introduction to Algorithms,
3rd Edition by Thomas
H.Cormen
Website
http://www.studytonight.com/
http://www.tutorialspoint.com/
http://www.firebase.com/
https://www.topcoder.com/
http://stackoverflow.com/

More Related Content

What's hot (20)

PPTX
Abstract class and Interface
Haris Bin Zahid
 
PPTX
Super keyword in java
Hitesh Kumar
 
PPT
Java And Multithreading
Shraddha
 
PDF
Java Servlets Tutorial | Introduction to Servlets | Java Certification Traini...
Edureka!
 
PPTX
Features of java
WILLFREDJOSE W
 
PPT
Swing and AWT in java
Adil Mehmoood
 
PDF
Introduction to Java Programming
Ravi Kant Sahu
 
PPSX
Java String class
DrRajeshreeKhande
 
PPT
Exception Handling in JAVA
SURIT DATTA
 
PDF
Java Basic Oops Concept
atozknowledge .com
 
PPTX
The Art of Metaprogramming in Java
Abdelmonaim Remani
 
PPTX
[OOP - Lec 18] Static Data Member
Muhammad Hammad Waseem
 
PPT
Java Threads
M Vishnuvardhan Reddy
 
PPTX
OOP Introduction with java programming language
Md.Al-imran Roton
 
PPTX
Java - Collections framework
Riccardo Cardin
 
PPTX
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
PPTX
INLINE FUNCTION IN C++
Vraj Patel
 
PDF
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 
PPT
Java interfaces
Raja Sekhar
 
PPTX
Operators in java
Then Murugeshwari
 
Abstract class and Interface
Haris Bin Zahid
 
Super keyword in java
Hitesh Kumar
 
Java And Multithreading
Shraddha
 
Java Servlets Tutorial | Introduction to Servlets | Java Certification Traini...
Edureka!
 
Features of java
WILLFREDJOSE W
 
Swing and AWT in java
Adil Mehmoood
 
Introduction to Java Programming
Ravi Kant Sahu
 
Java String class
DrRajeshreeKhande
 
Exception Handling in JAVA
SURIT DATTA
 
Java Basic Oops Concept
atozknowledge .com
 
The Art of Metaprogramming in Java
Abdelmonaim Remani
 
[OOP - Lec 18] Static Data Member
Muhammad Hammad Waseem
 
Java Threads
M Vishnuvardhan Reddy
 
OOP Introduction with java programming language
Md.Al-imran Roton
 
Java - Collections framework
Riccardo Cardin
 
Object Oriented Programing JAVA presentaion
Pritom Chaki
 
INLINE FUNCTION IN C++
Vraj Patel
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Edureka!
 
Java interfaces
Raja Sekhar
 
Operators in java
Then Murugeshwari
 

Viewers also liked (20)

PDF
WinterIssue_BSPages_InteriorsChicago_ ModernLuxury
Bianca Smith
 
PDF
The Emerging Field of Surface Imaging
Brigid Maher
 
PPTX
planning documents
Amber Dunham
 
PDF
8in_Wayside_10V-96G_and_96GK
Jerome Hines
 
PPTX
Reproduksi sel
Langkah Mudah Menuju Baitullah
 
PDF
CONTENT + STRATEGY = CONTENT STRATEGY
Brigid Maher
 
PPT
Maternal Health 2014 nazmul
Nazmul Alam
 
PPTX
Chaucer's Canterbury Tales - General Prologue and Characters Overview
Simonetta Collatina
 
PPTX
Job analysis hrm by obaid kakar
Obaid Kakar
 
PPTX
Byron's Life and Works
Simonetta Collatina
 
PPTX
Array operations
ZAFAR444
 
PPTX
القوائم المترابطة Linked List باستخدام لغة جافا
Mahmoud Alfarra
 
PPT
Super ontology stack_review_m36_051
John Domingue
 
PDF
Pop operation
Rajesh K Shukla
 
PDF
Stack: Recursion and Iteration
Rajesh K Shukla
 
DOC
Graphical representation of Stack
Sanjay Kumar Chakravarti
 
PDF
Quiz 2
Rajesh K Shukla
 
PDF
Data structures and algorithm analysis in java
Muhammad Aleem Siddiqui
 
PDF
(ِData Structures-Java Object oriented Programming Languages)ساختارهای دیتا ...
Muhibullah Aman
 
WinterIssue_BSPages_InteriorsChicago_ ModernLuxury
Bianca Smith
 
The Emerging Field of Surface Imaging
Brigid Maher
 
planning documents
Amber Dunham
 
8in_Wayside_10V-96G_and_96GK
Jerome Hines
 
CONTENT + STRATEGY = CONTENT STRATEGY
Brigid Maher
 
Maternal Health 2014 nazmul
Nazmul Alam
 
Chaucer's Canterbury Tales - General Prologue and Characters Overview
Simonetta Collatina
 
Job analysis hrm by obaid kakar
Obaid Kakar
 
Byron's Life and Works
Simonetta Collatina
 
Array operations
ZAFAR444
 
القوائم المترابطة Linked List باستخدام لغة جافا
Mahmoud Alfarra
 
Super ontology stack_review_m36_051
John Domingue
 
Pop operation
Rajesh K Shukla
 
Stack: Recursion and Iteration
Rajesh K Shukla
 
Graphical representation of Stack
Sanjay Kumar Chakravarti
 
Data structures and algorithm analysis in java
Muhammad Aleem Siddiqui
 
(ِData Structures-Java Object oriented Programming Languages)ساختارهای دیتا ...
Muhibullah Aman
 
Ad

Similar to Data structure and algorithm with java implementation by obaid kakar (20)

PPTX
Data structfghz€zdsrgnhlhlfdshllures.pptx
srahul53094
 
PDF
Data structures-sample-programs
Rajula Gurva Reddy
 
PDF
1 intro of data structure course
Mahmoud Alfarra
 
PPTX
CSE 443 (1).pptx
JayaKrishna636858
 
PDF
eBook Download Data Structures and Algorithm Analysis in Java, 3e Mark A. Wei...
ZhangAyuan
 
PDF
Data struture and aligorism
mbadhi barnabas
 
PDF
Dsa book
invertis university
 
PDF
Data structure & algorithm using java
Narayan Sau
 
PDF
A Practical Introduction To Data Structures And Algorithms Analysis, Java Edi...
Laurie Smith
 
PDF
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
Claire Webber
 
PDF
A practical introduction to data structures and algorithm analysis.pdf
Katie Robinson
 
PDF
DSA Report.pdf
ChhaviCoachingCenter
 
PDF
1-5 ADS Notes.pdf
RameshBabuKellamapal
 
PDF
Data Structures and Algorithm Analysis in C++, 3rd Edition by Dr. Clifford A....
thienvo61
 
PDF
viva.pdfjgthjghngnfgnfgnhfnhvndrcfbdrfgd
YashVerma195227
 
PPTX
Data Structure Lecture 1 in java .pptx
okokji4201
 
PPTX
PROGRAMMING COURSE DATA STRUCTURES
BALUJAINSTITUTE
 
PDF
data structures
Sai Lakshmi Cheedella
 
PDF
(SOS) Lipschutz, Seymour - Data Structures-McGraw Hill Education (2014).pdf
vitsrinu
 
Data structfghz€zdsrgnhlhlfdshllures.pptx
srahul53094
 
Data structures-sample-programs
Rajula Gurva Reddy
 
1 intro of data structure course
Mahmoud Alfarra
 
CSE 443 (1).pptx
JayaKrishna636858
 
eBook Download Data Structures and Algorithm Analysis in Java, 3e Mark A. Wei...
ZhangAyuan
 
Data struture and aligorism
mbadhi barnabas
 
Data structure & algorithm using java
Narayan Sau
 
A Practical Introduction To Data Structures And Algorithms Analysis, Java Edi...
Laurie Smith
 
A Practical Introduction To Data Structures And Algorithm Analysis Third Edit...
Claire Webber
 
A practical introduction to data structures and algorithm analysis.pdf
Katie Robinson
 
DSA Report.pdf
ChhaviCoachingCenter
 
1-5 ADS Notes.pdf
RameshBabuKellamapal
 
Data Structures and Algorithm Analysis in C++, 3rd Edition by Dr. Clifford A....
thienvo61
 
viva.pdfjgthjghngnfgnfgnhfnhvndrcfbdrfgd
YashVerma195227
 
Data Structure Lecture 1 in java .pptx
okokji4201
 
PROGRAMMING COURSE DATA STRUCTURES
BALUJAINSTITUTE
 
data structures
Sai Lakshmi Cheedella
 
(SOS) Lipschutz, Seymour - Data Structures-McGraw Hill Education (2014).pdf
vitsrinu
 
Ad

Recently uploaded (20)

PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PDF
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
PPTX
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Lesson 2 - WATER,pH, BUFFERS, AND ACID-BASE.pdf
marvinnbustamante1
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
BANDHA (BANDAGES) PPT.pptx ayurveda shalya tantra
rakhan78619
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 

Data structure and algorithm with java implementation by obaid kakar

  • 4. ACKNOWLEDGEMENTS Before every thing I would like to say thanks to almighty ALLAH for Giving me good Health and A good chance to Help Some One. I would like to express my deepest gratitude to my advisor, Sir Balach Bali, for his excellent guidance, caring, patience, and providing me with an excellent atmosphere for writing this short book . I would also like to thank to my Male And Female groups of study they always support me at every step. I would like to thank Sarim khan, Jamal afghan, Asif Alizai And Syed M.Asif ,Nirmal Kumar and Noman Jadoon who as good friends, were always willing to help and give their best suggestions. It would have been a lonely lab without them. I would also like to thank my mother and brothers. They were always supporting me and encouraging me with their best wishes.
  • 5. About author Obaid kakar Obaid kakar is the student of university of Balochistan Quetta Pakistan He did programming courses form Aptech north Nazimabad Karachi and also did many programs from Some institutes of Quetta. This short book of data structure and algorithm with java implementation is gift for University Of Balochistan. He is teacher in MIT Muslim Information Technology Quetta.
  • 6. Table of content Chapter 1: Overview pages o Introduction to data structure...............................3 o Introduction to Array...........................................5 o Introduction to link lists ......................................6 o Introduction to Stack ..........................................8 o Introduction to Queue ........................................9 o Introduction to Tree ...........................................9 o Introduction to Graph........................................10 o Data structure operations .................................11 o Algorithm and algorithmic notations...................13 Chapter 2: Array o Introduction ....................................................17 o Traversing .......................................................19 o Insertion in array..............................................23 o Deletion in array ..............................................31 o Searching techniques ........................................34 o Linear search ...................................................35 o Binary search....................................................37 o Short Summary ................................................40 Chapter 3: Sorting o Introduction .....................................................43 o Bubble sort........................................................43 o Selection sort.....................................................49 o Insertion sort.................................................... 55 o Merge Sort ......................................................62
  • 7. o Quick Sort........................................................67 o Time complexity...............................................74 o Short Summary .............................................. 79 Chapter 4: linked list o Introduction To Linked List............................82 o Singly linked list.............................................83 o Doubly link lists.............................................84 o Insertion Operation and Deletion Operation...86 o Singly Linked List In Detail............................90 o Traversing in link list .....................................90 o Insertion in Detail......................................... 92 o Deletion in Detail......................................... 102 o Summary: Linked List...................................106 Chapter 5: Stack and Queue o Introduction to stack......................................109 o Basic graphical representation .......................110 o Insertion /push..............................................111 o Deletion /Pop ...............................................113 o arithmetic expression in computer..................117 o From Infix To Prefix and Prefix to Infix ........119 o From Infix To Post Fix and Postfix to infix....121 o Introduction to Queue / Line.......................129 o Insertion in Queue.......................................131 o Deletion in Queue........................................137 o Short Summary............................................144
  • 8. Chapter 6: Tree And Graph o Introduction to tree.......................................147 o General Tree ...............................................149 o Binary tree...................................................150 o Complete Binary Tree..................................150 o Binary Search Tree (BST)............................154 o Traversing In BST ......................................157 o Insertion in BST..........................................161 o deletion in BST ..........................................164 o Introduction to Graph.................................171 o Graph and its representations......................173 o Graph Traversal ........................................179 o Depth First Search (DFS)...........................179 o Breadth First Search (BFS) .......................181 o Java Programs Examples Of graphs ...........181 o Short Summary..........................................197 o Summary of all chapters ..........201
  • 9. Introduction Chapter 1: overview: In this chapter you will Learn About the Data Structure and how its works and also overview of the some data structure like Array, Linked lists, Stack Queue, And Also Graph And Tree. Chapter 2: Arrays : There is full detail about array traversing, insertion deletion with graphical views and also java programs. And in this chapter you will also learn about how array can be organized in a memory. Chapter 3: Sorting Techniques: In this chapter you will be able to learn about the most use full Sorting technique like bubble sort, selection sort insertion sort, merge sort and Quick sort with graphical representation and Java Programs. And also can find here the time complexity of some algorithms. Chapter 4: Linked Lists. In this chapter you will find the detail about the linked lists. And how to traverse a linked lists and how to do insertion and deletion with the linked lists with graphical and theoretical explanation and with programs. Chapter 5: Stack And Queue In this chapter you find the detail about the stack and Queue how it works and its graphical representation and java programs of Insertion And Deletion. And this chapter also consists of some arithmetic Expressions and there conversion in detail. Chapter 6: Graph And Tree This chapter consists of the Detail About Tree BST and others and it also consist of Graph in detail and how to travers and insert and delete a value form graph and tree with java programs and graphical representation.
  • 216. Reference List People Sir Balach Bali Lecturer University Of Balochistan Computer Science Department Sir Bashir Marri. Programming Lecturer University Of Balochistan Computer Science Department Madam Shafaque Saira Malik IT Professional University Of Balochistan Computer Science Department Madam Asia Rasheed Lecturer: communication Skills , Technical report writing University Of Balochistan
  • 217. RefrenceBooks [CLRS] Thomas H. Cormen, Charles E. Leiserson, Ronald LRivest, CliffordStein. Introduction to Algorithms. McGraw-Hill, 2001. [Knuth] Donald E. Knuth. The Art of Computer Programming, Volumes 1-3. Addison-Wesley Professional, 1998. [Kishor] [Robert Lafore] [Thomas H. Cormen] S.B. Kishor Data Structures, Edition 3. Das Ganu Prakashan, Nagpur, 2008. Data Structures & Algorithms in Java by Robert Lafore Sams © 1998, Introduction to Algorithms, 3rd Edition by Thomas H.Cormen Website http://www.studytonight.com/ http://www.tutorialspoint.com/