Download - Big o Notataion

Transcript

BEST CASE, Worst Case And Big O Notation

TransverseInsert DeleteMax valueLinear searchBinary search

ComplexityBest case No best caseIf we want to insert an element at the last position of an array.If we want to delete the last element of an array.When our array is arranged in descending order i.e. the first element of an array is the largest.When we found the element at the first position of an array.When the value we want to find is at the middle of an array.

Worst caseNo worst caseIf we want to insert an element at the first position of an array.If we want to delete the first element of an array.When our array is arranged in ascending order i.e. the last element of an array is the largest.When we found the element at the last position of an array.When the value we want to find is at the first or at the last position of an array.

Big oO(n)O(n)O(n)O(n)O(n)O(log n)


Top Related