Skip to content

ChristopherAlphonse/Java-Foundation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAVA

Constant 0(1)

  • Time taken is independent of the amount of data.
  • Stack push,, pop, and peek; Queue enqueue and dequeue; insert a node into a linkedlist.

Linear 0(n)

  • Time taken is directly proportional to the amount of data
  • Linear search; count items in a list; Compare a pair of strings.

Quadratic 0(n^2)

  • Time take is proportional to the amount of data squared
  • Bubble sort; Selection sort; insert sort; Traverse a 2D array

Polynomial 0(n^k)

  • Time is proportional to the amount of data raise to the power of the a constant.

Logarithm 0(log n)

  • Time take is proportional to the logarithm of the amount of data
  • Binary search a sorted list; Search a binary tree

Linearithmetic 0(n log n)

  • Time taken is proportional to the logarithm of the amount of data, multiplied by the amount of data.
  • Merge sort; Quicksort

Exponential 0(K^n)

  • Time take is proportional to a constant raised to the power of the amount of data
  • N-Queens problem; Traveling salesman, passwords cracking

About

Practice DSA , System Design, and principles

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages