Skip to content

SvenWoltmann/o-notation-and-time-complexity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 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:

The Big O Cheat Sheet

👉 Use this FREE 1-page PDF cheat sheet as a reference to quickly look up the 7 most important time complexity classes (with descriptions + examples).

Hier geht's zur deutschen Version des PDFs

Java Versions PDF Cheat Sheet

👉 Save time and effort with this compact overview of all new Java features from the latest version back to Java 10.

In this practical and exclusive collection, you‘ll find the most important updates of each Java version summarized on one page each.

Hier geht's zur deutschen Version des PDFs

HappyCoders Newsletter

👉 Want to level up your Java skills? Sign up for the HappyCoders newsletter and get regular tips on programming, algorithms, and data structures!

Hier geht's zum deutschen Newsletter

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