0% found this document useful (0 votes)
36 views1 page

Data Structure Traverse Search Unsorted L List N N Sorted L List N N Unsorted Arrayn N Sorted Array N Binary Tree N N BST NN F&B BST N

This document compares the time complexities of common sorting algorithms including BubbleSort, SelectionSort, InsertionSort, BitonicSort, ShellSort, QuickSort, HeapSort, SmoothSort, MergeSort, TimSort, CountingSort, RadixSort and BucketSort. It shows their worst case, average case and best case time complexities. It also lists whether each algorithm is stable and its extra space complexity requirements. Additional information is provided on sequential searching, binary searching and tenary searching time complexities and traversing and searching common data structures.

Uploaded by

biyu606
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views1 page

Data Structure Traverse Search Unsorted L List N N Sorted L List N N Unsorted Arrayn N Sorted Array N Binary Tree N N BST NN F&B BST N

This document compares the time complexities of common sorting algorithms including BubbleSort, SelectionSort, InsertionSort, BitonicSort, ShellSort, QuickSort, HeapSort, SmoothSort, MergeSort, TimSort, CountingSort, RadixSort and BucketSort. It shows their worst case, average case and best case time complexities. It also lists whether each algorithm is stable and its extra space complexity requirements. Additional information is provided on sequential searching, binary searching and tenary searching time complexities and traversing and searching common data structures.

Uploaded by

biyu606
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Worst case

Average case
Best case
BubbleSort
O(n^2)
O(n^2)?
O(n)
SelectionSort
O(n^2)
O(n^2)
O(n^2)
(it can depend on sort order and data arrangement)
InsertionSort
O(n^2)
O(n^2)
O(n)
BitonicSort

O(n log^2 n)

ShellSort
QuickSort
HeapSort
SmoothSort

O(n^2)
O(n^2)
O(n log n)
O(n log n)

O(n
O(n
O(n
O(n

n)?
n)
n)
n)?

MergeSort
TimSort

O(n log n)
O(n log n)

O(n log n)
O(n log n)?

CountingSort
RadixSort
BucketSort

O(n+k)
O(n+k)
O(n^2)

O(n log^2 n)?


log
log
log
log

O(n+k)
O(n+k)
O(n+k)

Extra space
O(1)
O(1)

Stable?
yes
No

O(1)

yes

O(1)?

O(n)
O(n log n)
O(n log n)
O(n)

O(1)
O(log n)
O(1)
O(1)

no
no
no
no

O(n log n)
O(n)

O(n)
O(n)

yes
yes

O(n+k)
O(n+k)
?????

O(n+k)
yes
O(n+k)
yes
O(n*k) or O(n+k) ?

Sequential Searching Can search from unordered list Time complexity O(n)
Binary searching Can search from ordered list only Time complexity O(log 2n)
Tenary searching Can search from ordered list only Time complexity O(log 3n)

Data Structure Traverse


Search
Unsorted L List N N
Sorted L List N N
Unsorted Array N N
Sorted Array N Log N
Binary Tree N N
BST N N
F&B BST
N Log N

You might also like