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 (13)

marketing plan of a new telecom company
marketing plan of a new telecom company
Imran Sajol
 
Case study NOKIA failure
Case study NOKIA failure
Nildip Patel
 
Batch file programming
Batch file programming
alan moreno
 
Business environment and analysis of nokia
Business environment and analysis of nokia
shaunakbajpai
 
Tk2323 lecture 1 introduction to mobile application
Tk2323 lecture 1 introduction to mobile application
MengChun Lam
 
iOS General Case Study
iOS General Case Study
Karmesh Maheshwari
 
Marketing Analysis of Samsung Products..
Marketing Analysis of Samsung Products..
Aniket Wilson
 
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
GbadeboTEkunola
 
Rajesh ppt
Rajesh ppt
Swarnima Tiwari
 
DoozyUI_基礎介紹教學
DoozyUI_基礎介紹教學
River Wang
 
Samsung ppt
Samsung ppt
Danish Shamsher
 
Purpose of command interpreter
Purpose of command interpreter
Sumant Diwakar
 
java ppt.pdf
java ppt.pdf
PriyaMaurya52
 
marketing plan of a new telecom company
marketing plan of a new telecom company
Imran Sajol
 
Case study NOKIA failure
Case study NOKIA failure
Nildip Patel
 
Batch file programming
Batch file programming
alan moreno
 
Business environment and analysis of nokia
Business environment and analysis of nokia
shaunakbajpai
 
Tk2323 lecture 1 introduction to mobile application
Tk2323 lecture 1 introduction to mobile application
MengChun Lam
 
Marketing Analysis of Samsung Products..
Marketing Analysis of Samsung Products..
Aniket Wilson
 
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
AN INTRODUCTION TO MOBILE APPLICATION DEVELOPMENT
GbadeboTEkunola
 
DoozyUI_基礎介紹教學
DoozyUI_基礎介紹教學
River Wang
 
Purpose of command interpreter
Purpose of command interpreter
Sumant Diwakar
 

Viewers also liked (20)

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

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

Teach yourself logic 2017
Teach yourself logic 2017
mustafa sarac
 
Teach yourself logic 2017
Teach yourself logic 2017
mustafa sarac
 
A First Course In Linear Algebra Congruent Press
A First Course In Linear Algebra Congruent Press
Maria Perkins
 
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Kevin Meade
 
The java interview questions ebook - confused coders
The java interview questions ebook - confused coders
Yash Sharma
 
Active Learning Literature Survey
Active Learning Literature Survey
butest
 
Table of contents [data structure and algorithmic thinking with python]
Table of contents [data structure and algorithmic thinking with python]
CareerMonk Publications
 
Sample chapters [data structure and algorithmic thinking with python]
Sample chapters [data structure and algorithmic thinking with python]
CareerMonk Publications
 
Clean Architectures in Python.pdf
Clean Architectures in Python.pdf
HonorioCandelario
 
Datastructuresandalgorithms
Datastructuresandalgorithms
Niharika Sahay
 
Data structures and algorithms made easy
Data structures and algorithms made easy
CareerMonk Publications
 
Passport workbook 2009 10 web version
Passport workbook 2009 10 web version
Welling School Sixth Form
 
A first course in linear algebra robert a. beezer university of puget sound v...
A first course in linear algebra robert a. beezer university of puget sound v...
chen john
 
Enriched Learning Projects Illustrated James A Bellanca
Enriched Learning Projects Illustrated James A Bellanca
pecenjeeson
 
English 102 Analytic Thinking
English 102 Analytic Thinking
erika rodriguez
 
Foundations Of Complex Analysis 2nd Edition Saminathan Ponnusamy
Foundations Of Complex Analysis 2nd Edition Saminathan Ponnusamy
fathikparve
 
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
Sahat Hutajulu
 
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
Sahat Hutajulu
 
Mega assignment social group work
Mega assignment social group work
Uzma Abbas Shirazi
 
ACT_RR2015-4
ACT_RR2015-4
Mary Ann Hanson, PhD
 
Teach yourself logic 2017
Teach yourself logic 2017
mustafa sarac
 
Teach yourself logic 2017
Teach yourself logic 2017
mustafa sarac
 
A First Course In Linear Algebra Congruent Press
A First Course In Linear Algebra Congruent Press
Maria Perkins
 
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Oracle SQL Performance Tuning and Optimization v26 chapter 1
Kevin Meade
 
The java interview questions ebook - confused coders
The java interview questions ebook - confused coders
Yash Sharma
 
Active Learning Literature Survey
Active Learning Literature Survey
butest
 
Table of contents [data structure and algorithmic thinking with python]
Table of contents [data structure and algorithmic thinking with python]
CareerMonk Publications
 
Sample chapters [data structure and algorithmic thinking with python]
Sample chapters [data structure and algorithmic thinking with python]
CareerMonk Publications
 
Clean Architectures in Python.pdf
Clean Architectures in Python.pdf
HonorioCandelario
 
Datastructuresandalgorithms
Datastructuresandalgorithms
Niharika Sahay
 
Data structures and algorithms made easy
Data structures and algorithms made easy
CareerMonk Publications
 
A first course in linear algebra robert a. beezer university of puget sound v...
A first course in linear algebra robert a. beezer university of puget sound v...
chen john
 
Enriched Learning Projects Illustrated James A Bellanca
Enriched Learning Projects Illustrated James A Bellanca
pecenjeeson
 
English 102 Analytic Thinking
English 102 Analytic Thinking
erika rodriguez
 
Foundations Of Complex Analysis 2nd Edition Saminathan Ponnusamy
Foundations Of Complex Analysis 2nd Edition Saminathan Ponnusamy
fathikparve
 
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
Sahat Hutajulu
 
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
[Sundstrom_Ted.]_Mathematical_Reasoning_Writing - Copy.pdf
Sahat Hutajulu
 
Mega assignment social group work
Mega assignment social group work
Uzma Abbas Shirazi
 
Ad

Recently uploaded (20)

IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Rai dyansty Chach or Brahamn dynasty, History of Dahir History of Sindh NEP.pptx
Dr. Ravi Shankar Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
IDF 30min presentation - December 2, 2024.pptx
IDF 30min presentation - December 2, 2024.pptx
ArneeAgligar
 
Publishing Your Memoir with Brooke Warner
Publishing Your Memoir with Brooke Warner
Brooke Warner
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
PEST OF WHEAT SORGHUM BAJRA and MINOR MILLETS.pptx
Arshad Shaikh
 
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Analysis of Quantitative Data Parametric and non-parametric tests.pptx
Shrutidhara2
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Webcrawler_Mule_AIChain_MuleSoft_Meetup_Hyderabad
Veera Pallapu
 
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
SPENT QUIZ NQL JR FEST 5.0 BY SOURAV.pptx
Sourav Kr Podder
 
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
ROLE PLAY: FIRST AID -CPR & RECOVERY POSITION.pptx
Belicia R.S
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
ABCs of Bookkeeping for Nonprofits TechSoup.pdf
TechSoup
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
LDMMIA Spring Ending Guest Grad Student News
LDMMIA Spring Ending Guest Grad Student News
LDM & Mia eStudios
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 

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/