Asymptotic Notation

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Asymptotic Notation (mathematics)

Describes the limiting behavior of a function when the argument tends towards a particular value, or infinity.

Queue: deletion time

O(1)

Queue: insertion time

O(1)

Stack: deletion time

O(1)

Stack: insertion time

O(1)

Array: access time

O(1) - Elements are stored next to one another in memory.

Linked List: deletion time

O(1) - If the address of the node previous to the one to be deleted is known.

Linked List: insertion time

O(1) - If we are at the position where we have to insert an element.

Linked List: access time

O(n)

Linked List: search time

O(n)

Queue: access time

O(n)

Queue: search time

O(n)

Stack: access time

O(n)

Stack: search time

O(n)

Array: search time

O(n) - For sequential search O(logn) - For binary search (if array is sorted)

Array: deletion time

O(n) - The worst case is a deletion at the beginning of the array, causing all other elements to shift.

Array: insertion time

O(n) - The worst case is an insertion at the beginning of the array, causing all other elements to shift.

Asymptotic Notation (CompSci)

Used to classify algorithms according to how their running time or space requirements grow as the input size grows.


Set pelajaran terkait

SIE Section 1 Chapter 4 "Investment Company Securities"

View Set

Porth's PrepU: Chapter 43: Disorders of the Bladder and Lower Urinary Tract

View Set

Module 11 The Complex World of IT Professionals

View Set

Pharmacology Chapter 24 Part 2 --DRUG THERAPY- RECHECKED

View Set

Integrated Media Planning Quizzes

View Set

Chapter 11 & 12 corporate finance

View Set