Advanced Data Structures and Algorithms: Learn how to enhance data processing with more complex and advanced data structures by Abirami A & Priya R L

Advanced Data Structures and Algorithms: Learn how to enhance data processing with more complex and advanced data structures by Abirami A & Priya R L

Author:Abirami A & Priya R L [A, Abirami & L, Priya R]
Language: eng
Format: epub, pdf
ISBN: 9789355517920
Publisher: BPB Publications
Published: 2023-07-15T00:00:00+00:00


Analysis of algorithm

T(n) = 7T(n/2) + O(n^2) = O(n^log(7)) runtime.

Approximately O(n^2.8074) which is better than O(n^3)

Conclusion

Searching is the operation of finding the elements from the given set of data. Binary search is more efficient than linear search. In binary search, the elements in the array must be sorted, which is not in the case of linear search. Binary search comes under divide and conquer using search technique. In each step, the binary search algorithm divides the array into two parts and checks if the element to be searched, is on the upper or lower half of the array. Best case is O(1), and average case and worst case for binary search is O(log2n).

In the Max-min problem, for a given array, we must find the maximum and minimum elements. Before the divide and conquer approach, the maximum and minimum elements could be found by comparing every element in the list, but by using divide and conquer, the comparisons have reduced.

Merge sort sorts the list, using the divide and conquer technique. Merge sort uses a two-way merge process. The best case and worst case for this sorting technique is O( nlog2n).

Quick sort selects one pivot element and then moves it to the correct position by fixing the pivot, then dividing the list into equal or unequal size. Best case is O(nlog2n), and worst case is O(n2).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.