You are on page 1of 3

2/6/2017 AlgorithmsDataStructures

DATA STRUCTURES
HOME SUBJECTS DOWNLOADS AUTHORS
CONTACT US
UNIT 1
Introduction
to Algorithm Introduction to Algorithm
Performance
Analysis What is an algorithm?
Space
Complexity An algorithm is a step by step procedure to solve a problem. In normal
Time language, algorithm is defined as a sequence of statements which are used
to perform a task. In computer science, an algorithm can be defined as
Complexity
follows...
Asymptotic
Notations
An algorithm is a sequence of unambiguous instructions used for
Linear & Non
solving a problem, which can be implemented (as a program) on a
Linear Data computer
Structures
Single Linked
Algorithms are used to convert our problem solution into step by step
List
statements. These statements can be converted into computer programming
Circular instructions which forms a program. This program is executed by computer
Linked List to produce solution. Here, program takes required data as input, processes
Double Linked data according to the program instructions and finally produces result as
List shown in the following picture.
Arrays
Sparse Matrix
UNIT 2
Stack ADT
Stack Using
Array
Stack Using
Algorithm Specifications
Linked List Every algorithm must satisfy the following specifications...
Expressions
Infix to Postfix 1. Input Every algorithm must take zero or more number of input values
from external.
Postfix
2. Output Every algorithm must produce an output as result.
Evaluation 3. Definiteness Every statement/instruction in an algorithm must be
Queue ADT clear and unambiguous (only one interpretation)
Queue Using 4. Finiteness For all different cases, the algorithm must produce result
Array within a finite number of steps.

http://btechsmartclass.com/DS/U1_T1.html 1/3
2/6/2017 AlgorithmsDataStructures

Queue Using 5. Effectiveness Every instruction must be basic enough to be carried


Linked List out and it also must be feasible.
Circular Queue
Double Ended Example of Algorithm
Queue
Let us consider the following problem for finding the largest value in a given
UNIT 3
list of values.
Tree
Terminology Problem Statement : Find the largest number in the given list of numbers?
Tree Input : A list of positive integer numbers. (List must contain at least one
Representations number).
Binary Tree Output : The largest number in the given list of positive integer numbers.
Binary Tree
Consider the given list of numbers as 'L' (input), and the largest number as
Representations
'max' (Output).
Binary Tree
Traversals
Algorithm
Threaded
Binary trees Step 1: Define a variable 'max' and initialize with '0'.
Max Priority
Queue Step 2: Compare first number (say 'x') in the list 'L' with 'max', if 'x' is
Max Heap larger than 'max', set 'max' to 'x'.
Introduction Step 3: Repeat step 2 for all numbers in the list 'L'.
to Graphs
Graph Step 4: Display the value of 'max' as a result.
Representations
Graph Code in C Programming
Traversal DFS
Graph

Traversal BFS intfindMax(L)
UNIT 4 {
Linear Search intmax=0,i;
for(i=0;i<listSize;i++)
Binary Search {
Hashing if(L[i]>max)
max=L[i];
Insertion Sort }
Selection Sort returnmax;
}
Radix Sort
Quick Sort
Heap Sort
Comparison of
Recursive Algorithm
Sorting In computer science, all algorithms are implemented with programming
Methods language functions. We can view a function as something that is invoked
UNIT 5 (called) by another function. It executes its code and then returns control to
Binary Search the calling function. Here, a function can call themselves (by itself) or it
Tree may call another function which again call same function inside it.
AVL Trees

http://btechsmartclass.com/DS/U1_T1.html 2/3
2/6/2017 AlgorithmsDataStructures

B Trees
The function which calls by itself is called as Direct Recursive
Red Black
function (or Recursive function)
Trees
Splay Trees
A recursive algorithm can also be defined as follows...
Comparison of
Search Trees
KnuthMorris The function which calls a function and that function calls its called
Pratt function is called Indirect Recursive function (or Recursive function)
Algorithm
Tries Most of the computer science students think that recursive is a technique
useful for only a few special problems like computing factorials,
Ackermann's function etc., This is unfortunate because any function
implemented using assignment or ifelse or while or looping statements can
also be implemented using recursive functions. This recursive function is
very easier to understand when compared to its iterative counterpart.

Next

About UsContact Us

Website designed by RAJINIKANTH B

http://btechsmartclass.com/DS/U1_T1.html 3/3

You might also like