Program of Merge Sort
Description * Merge sort is a algorithm that uses the divide, conquer and combine algorithm. * Steps of merge sort 1) Partition the n-element array into two sub-arrays of n/2…
All Program Related To Data Structure
Description * Merge sort is a algorithm that uses the divide, conquer and combine algorithm. * Steps of merge sort 1) Partition the n-element array into two sub-arrays of n/2…
Description It inserts each element into its proper place in the final list. More efficient than selection sort and bubble sort. Process of Insertion Sort 1) loop from first element…
Description * Bubble sort repeatedly swap the adjacent elements if they are not sorted. * Largest element repeatedly move to highest index, if elements are sored in acscending order or…
Description * In selection sort 1. In first iteration, find minimum element and swap with first position 2. In second iteration, find second minimum element and swap with second position…
Description For binary search, array must be sorted. First compare element with the middle element. If element matches with middle element, return mid index. If element is greater than the…
Description To remove duplicate elements from singly linked list - Case 1: check if list is empty Show message that list is empty. Case 2: If list has elements a)…
Description To search element in singly linked list - Case 1: check if list is empty Show message that list is empty. Case 2: If list has elements Traverse the…
Description Finding maximum and minimum element of singly linked list - 1. How to find maximum element Step 1: Storing maximum value into one variable. Step 2: Traversing the loop…
Description To Reverse elements of singly linked list - Case 1: Check if list is empty Show message that list is empty. Case 2: If list has elements Recursively the…
Description To sort elements of singly linked list - Case 1: Check if list is empty Show message that list is empty. Case 2: If list has only one elements…