Precat Fast Track Batch OM21
Precat Fast Track Batch OM21
Precat Fast Track Batch OM21
PRECAT FAST
FAST TRACK
TRACK BATCH
BATCH
OM21
OM21
SunBeam
SunBeam Institute
Institute of
of
Information
Information &
& Technology,
Technology,
Hinjwadi,
Hinjwadi, Pune
Pune &
& Karad.
Karad.
SACHIN
SACHIN PAWAR
PAWAR
Sunbeam Infotech www.sunbeaminfo.com
Data Structures: Introduction
+ Introduction
- Data structure
- Algorithm and analysis of an algorithm
+ Array
- Concept & definition
- Searching Algorithms:
1. Linear Search
2. Binary Search
- Sorting Algorithms:
1. Selection Sort
2. Bubble Sort
3. Insertion Sort
4. Quick Sort
5. Merge sort
+ Linked List
- Concept & definition
- Types of Linked List
- Operations on Linked List
- Differnce between an array and linked list
+ Stack
- Concept & definition
- Implementation of stack data structure
- Stack applications algorithms:
1. Conversion of infix expression into its equivalent prefix
2. Conversion of infix expression into its equivalent postfix
3. Conversion of prefix expression into its equivalent postfix
4. Postfix expression evalution
+ Queue
- Concept & definition
- Types of queue
- Implementation of queue data structure
- Applications of queue
Union: Union is same like structure, except, memory allocation i.e. size
of union is the size of max size member defined in it and that memory
gets shared among all its members for effective memory utilization (can
be used in a special case only).
Q. What is a Program?
- A program is a finite set of instructions written in any programming
language (like C, C++, Java, Python, Assembly etc...) given to the machine to
do specific task.
Q. What is an Algorithm?
- An algorithm is a finite set of instructions written in human understandable
language (like english), if followed, acomplishesh a given task.
- An algorithm is a finite set of instructions written in human understandable
language (like english) with some programming constraints, if followed,
acomplishesh a given task, such an algorithm also called as pseudocode.
- An algorithm is a template whereas a program is an
implementation of an algorithm.
"Best case time complexity": if an algo takes min amount of time to run to
completion then it is referred as best case time complexity.
"Worst case time complexity": if an algo takes max amount of time to run to
completion then it is referred as worst case time complexity.
"Average case time complexity": if an algo takes neither min nor max
amount of time to to run to completion then it is referred as an average case
time complexity.
"Asympotic Notations":
1. Big Omega (Ω):): this notation is used to denote best case time complexity –
also called as asymptotic lower bound
2. Big Oh (O): this notation is used to denote worst case time complexity -
also called as asymptotic upper bound
3. Big Theta (θ):): this notation is used to denote an average case time
complexity - also called as asymptotic tight bound
- as in each iteration one comparison takes place and search space is getting reduced by half.
n => n/2 => n/4 => n/8 ......
after iteration-1 => n/2 + 1 => T(n) = (n/21 ) + 1
after iteration-2 => n/4 + 2 => T(n) = (n/22 ) + 2
after iteration-3 => n/8 + 3 => T(n) = (n/23 ) + 3
after k iterations => T(n) = (n/2k ) + k ...... (equation-I)
let us assume,
=> n = 2k
=> log n = log 2k (by taking log on both sides)
=> log n = k log 2
=> log n = k
=> k = log n
By substituting value of n & k in equation-I, we get
=> T(n) = (n / 2k ) + k
=> T(n) = ( 2k / 2k ) + log n
=> T(n) = 1 + log n => T(n) = log n => T(n) = O(log n).