Post on 15-Jan-2017
transcript
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.
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/