Kadi Sarva Vishwavidyalaya: LDRP Institute of Technology and Research Gandhinagar

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

KADI SARVA VISHWAVIDYALAYA

LDRP INSTITUTE OF TECHNOLOGY AND RESEARCH


GANDHINAGAR

Department of
Computer Engineering and Information Technology

Subject : Design and Analysis of Algorithm (CE-504N)

Laboratory Manual

Prepared By
Ney Kiritbhai Patel

18BECE30108

5CE-D
Lab Manual DAA(CE 504N)
INDEX

Practical Date of
Name of Experiment Page Sign
No Submission
1 Revision of Data Structures: Write a program to implement:
a. A Queue
b. A Stack
c. A Queue using two Stacks
d. A Stack using two Queues
  3-20   22-July-2020  
2 Basics:
Find out Big - Oh and Big–Omega of the function.
 30-33 6-August-2020   
3 Aim: Design an algorithm and implement a program for:
a. Bubble Sort
b. Selection Sort
c. Insertion Sort
d. Linear Search
e. Radix Sort  21-29   29-July-2020  
4

     
5

     
6      
7

     
8
     
9

     
10
     
11
     

18BECE30108
Lab Manual DAA(CE 504N)
Experiment 2

Aim: Find out Big - Oh and Big–Omega of the function

Explanation:

Big-Oh Notation:
 It represents the lower bound of the function.
 f(n) and g(n) are two functions for comparison purpose. where f(n) should be less than or equal
to the g(n).

Examples:
1) Prove that 2n + 10 is O(n)
2) Prove that 7n-2 is O(n)
3) Prove that 3 log n + log log n is O(log n)
4) n^4 + 100n^2 + 10n + 50 is O(n^4)
5) 10n^3 + 2n^2 is O(n^3)
6) n^3 – n^2 is O(n^3)
7) 2n^2 = O(n^3)
8) 1000n^2+1000n = O(n^2)
9) 30n+8 is O(n)
10) Prove that 100n + 5 = O(n^2)

18BECE30108
Lab Manual DAA(CE 504N)
Solution:

Page-1 Page-2

Page-3 Page-4

18BECE30108
Lab Manual DAA(CE 504N)
Big-Omega Notation:
 It represent the upper bound of the function.
 f(n) and g(n) are two functions for comparison purpose. Where f(n) should be greater than or
equal to the g(n).

Example:
1) n = Ω(2n)
2) n3 = Ω (n2)
3) n = Ω (logn)
4) 100n + 5 ≠ Ω (n2)
5) 5n2 = Ω (n)

18BECE30108
Lab Manual DAA(CE 504N)
Solution:

Page-1 Page-2

Conclusion:
In this practical we have learned about Big Oh and Big Omega function. We have also counted examples of
Big Oh and Big Omega.

18BECE30108

You might also like