Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

CvSU Vision CvSU Mission

The premier university in Cavite State University shall provide


historic Cavite globally recognized excellent, equitable and relevant educational
for excellence in character opportunities in the arts, science and
development, academics, technology through quality instruction and
research, innovation and relevant research and development activities.
community engagement. It shall produce professional, skilled and
Republic of the Philippines morally upright individuals for global
CAVITE STATE UNIVERSITY competitiveness.

Carmona Campus
Market Road, Carmona, Cavite
🕾 (046) 487-6328/carmonacampus@cvsu.edu.ph
www.cvsu.edu.ph

ACTIVITY SHEET 7 IN COSC 90

NAME: Jon Zyruz D. Zaragoza DATE: May 21, 2024


YEAR/SECTION: BSCS-3B SCORE:__________________

Date of Submission: May 24, 2024 (3B) / May 26, 2024 (3A)
Direction: Read and answer the following questions. All answers must be written here in this
activity sheet. Failure to comply will result in activity score deductions.

1. Create a table displaying the eight basic asymptotic efficiency classes. Give at least two
examples where each class is applied.

Answers:
Efficiency Name Examples
Classes
O(1) Constant Accessing an array index.
The push and pop process of a stack.
The enqueue and dequeue process of a queue.

O(log n) Logarithmic Binary search.


Calculating Fibonacci numbers
Finding the largest or smallest number in a binary search tree.

O(n) Linear A function that accesses every element in an array


Searching for a specific integer in an array.
Comparing two strings.
Checking for a Palindrome.
Reading a book.

O(n log n) Linearithmitc Merge Sort.


Quick Sort.
Heap Sort.
O(n2) Quadratic Bubble Sort.
Insertion Sort.
Selection Sort.
Iterating through nested two (2) loops.

O(n3) Cubic Matrix Multiplication.


Iterating through nested three (3) loops.

O(2n) Exponential The Tower of Hanoi (Recursive Fibonacci sequence).


Finding the exact solution to the traveling salesman problem
using dynamic programming.

O(n!) Factorial The traveling salesman problem using brute-force search.


Enumerating all partitions of a set.
Creating all permutations of an ordered set.

References:
Asymptotic notation: Asymptotic notation cheatsheet | Codecademy. (n.d.). Retrieved from

https://www.codecademy.com/learn/cspath-asymptotic-notation/modules/cspath-

asymptotic-notation/cheatsheet

Olawanle, J. (2023, April 10). Big o cheat sheet – Time Complexity chart. Retrieved from

https://www.freecodecamp.org/news/big-o-cheat-sheet-time-complexity-chart/

Singh, V. (2024, January 17). Asymptotic Analysis: Unraveling the complexity of algorithms -

Shiksha Online. Retrieved from https://www.shiksha.com/online-courses/articles/introduction-to-

asymptotic-analysis/

Studocu. (n.d.-b). Asymptotic Notations and Basic Efficiency Classes - To compare and rank

such orders of growth, - Studocu. Retrieved from https://www.studocu.com/en-


us/document/massachusetts-institute-of-technology/introduction-to-

algorithms/asymptotic-notations-and-basic-efficiency-classes/54115833

Wikipedia contributors. (2024, April 26). Algorithmic efficiency. Retrieved from

https://en.wikipedia.org/wiki/Algorithmic_efficiency

Wikipedia contributors. (2024, April 29). Big O notation. Retrieved from

https://en.wikipedia.org/wiki/Big_O_notation#Orders_of_common_functions

You might also like