Skip to content

SvenWoltmann/o-notation-and-time-complexity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

O Notation and Time Complexity

What is "Big O notation" and "time complexity"?

Code examples demonstrating the following complexity classes:

  • O(1) - constant time (inserting elements at the beginning of a linked list)
  • O(n) - linear time (summing up all elements of an array)
  • O(n²) - quadratic time (sorting an array with Insertion Sort)
  • O(log n) - logarithmic time (finding an element within a sorted array using binary search)
  • O(n log n) - quasi-linear time (sorting an array with Quicksort)

The code belongs to this article:

About

Code examples demonstrating the complexity classes O(1), O(log n), O(n), O(n log n), O(n²).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages