C Program to Search Sorted Sequence using Divide and Conquer

This C program searches for an element in a sorted array with the aid of fibonacci numbers. The Fibonacci search technique is a method of searching a sorted array using a divide and conquer algorithm that narrows down possible locations with the aid of Fibonacci numbers. Compared to binary search, Fibonacci search examines locations whose … Read more

advertisement

C Program to Find kth Largest Element in a Sequence

This C program finds the kth largest element in a sequence. QuickSelect, a variant of quicksort algorithm is used to find the kth largest element in a sequence in O(n) time. Here is the source code of the C program to find the kth largest element in a sequence. The C program is successfully compiled … Read more

advertisement

C Program to Perform Uniform Binary Search

This C program performs uniform binary search. Uniform binary search is an optimization of the classic binary search algorithm invented by Donald Knuth and given in Knuth’s The Art of Computer Programming. It uses a lookup table to update a single array index, rather than taking the midpoint of an upper and a lower bound … Read more

advertisement

C Program to Implement Shaker Sort

This C program sorts a given array of integer numbers using Shaker Sort technique. Cocktail sort, also known as bidirectional bubble sort, cocktail shaker sort, shaker sort (which can also refer to a variant of selection sort), ripple sort, shuffle sort, or shuttle sort, is a variation of bubble sort that is both a stable … Read more

advertisement

C Program to Implement Counting Sort

This C program sorts a given array of integer numbers using Counting Sort technique. Counting sort is an algorithm for sorting a collection of objects according to keys that are small integers; that is, it is an integer sorting algorithm. It operates by counting the number of objects that have each distinct key value, and … Read more

advertisement

C Program to Sort Linked List using Merge Sort

This C program sorts an integer linked list using Merge Sort technique. A linked list cannot be accessed randomly and because of this slow access time, sorting algorithms like quick sort cannot be applied to it. So we use merge sort for this purpose. It works on divide and conquer technique. Time complexity is O(nlogn). … Read more

advertisement

Selection Sort Program in C

What is Selection Sort in C? Selection sort is a sorting algorithm in C that works by dividing an array into two parts: the sorted part and the unsorted part. Initially, the sorted part is empty, while the unsorted part contains all the elements. The algorithm repeatedly finds the smallest element from the unsorted part … Read more

advertisement

C Program to Implement Heap Sort

This C program sorts a given array of integer numbers using Heap Sort technique. Depending upon the value of MAX we create an integer array with numbers ranging from 0 to MAX – 1. Using random_shuffle function we randomize the array and the sort it using heap sort algorithm. Time Complexity of this algorithm is … Read more

advertisement

C Program to Sort an Array using Randomized Quick Sort Technique

This C program sorts a given array of integer numbers using randomized Quick sort technique. It is comparison sort which works on divide and conquer technique. It is in-place partitioning algorithm and one of the fastest sorting techniques available till date. Average Time Complexity of this algorithm is O(nlog(n)). Here is the source code of … Read more

advertisement

C program to Sort Integers using Quick Sort Technique

This C program sorts a given array of integer numbers using Quick Sort technique. It is comparison sort which works on divide and conquer technique. It is in-place partitioning algorithm and one of the fastest sorting techniques available till date. Average Time Complexity of this algorithm is O(nlog(n)). Increase the value of MAX to generate … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.