1/16
Looks like no tags are added yet.
What are linear searches ideal for
Finding items in small data sets, searching unordered data (eg settings file), find-and-replace function in word processors
What are binary searches ideal for
Searching for items in large, sorted data sets, online dictionaries
Time complexity of linear search - BEST case
O(1) constant
Time complexity of linear search - AVERAGE/WORST case
O(n) linear
Time complexity of binary/binary tree search - BEST case
O(1) constant
Time complexity of binary search - AVERAGE/WORST case
O(log n) logarithmic
Time complexity of binary search tree - AVERAGE case
O(log n) logarithmic
Time complexity of binary search tree - WORST case
O(n) linear
Space complexity of linear search
O(1) constant
Space complexity of binary search
O(1) constant
What are bubble sorts ideal for
Very small data sets, situations when easy-to-program sorting algorithm is required
What are merge sorts ideal for
Larger data sets where memory is not a concern, parallel processing environments
Time complexity of bubble sort - BEST case
O(n) linear
Time complexity of merge sort - BEST/AVERAGE/WORST case
O(n log n) linearithmic
Time complexity of bubble sort - AVERAGE/WORST case
O(n2) polynomial
Space complexity of bubble sort
O(1) constant
Space complexity of merge sort
O(n) linear