C Program to Find Majority Element in a Sorted Array

This C Program checks if a given integer X appears more than N/2 times in a sorted array of N integers. Here is source code of the C Program to find if a given integer X appears more than N/2 times in a sorted array of N integers. The C program is successfully compiled and … Read more

advertisement

C Program Merge and Sort Elements of 2 Different Arrays

This C Program merge and sort elements of 2 different arrays Here is source code of the C Program to merge and sort elements of 2 different arrays. The C program is successfully compiled and run on a Linux system. The program output is also shown below. /* * C Program to Merge and Sort Elements … Read more

advertisement

C Program to Implement Selection Sort using Recursion

This C Program implements a Selection sort. Selection sort works by finding the smallest unsorted item in the list and swapping it with the item in the current position. It is used for sorting unsorted list of elements. Here is the source code of the C program to display a linked list in reverse. The … Read more

advertisement

C Program to Perform Binary Search using Recursion

This is a C Program to search an element in an Array using Binary Search Algorithm using recursion. Problem Description We have to create a C Program which inputs a sorted array and tells whether the key searched is present in array or not using Binary Search Algorithm recursively. We have to take array and … Read more

advertisement

C Program to Merge Two Sorted Array Elements

Merging two arrays in c is similar to Concatenating or combining two arrays into a single array. For example, if the first array has four elements and the second array has five elements, the resulting array has nine elements. Example: First Array = [1, 2, 3, 4, 5] Second Array = [6, 7, 8, 9, … Read more

advertisement

C Program to Implement Merge Sort Algorithm

Problem Description Write a C program to perform a merge sort using recursion and function. What is Merge Sort? Merge Sort is a divide and conquer-based sorting algorithm. In this sorting algorithm the unsorted array keeps on dividing into two halves until the array is either empty or contains only one element, which is the … Read more

advertisement

Quick Sort Program in C

Problem Description Write a C program to implement the Quick Sort algorithm. Problem Solution To approach this problem, we will use the divide and conquer algorithm. What is Quick Sort? Quick sort is a divide and conquer algorithm. It works by recursively partitioning the array into two parts, the left side of the array containing … Read more

advertisement

C Program to Find the Median of Two Sorted Arrays of Same Size

This is a C Program to find the median of the elements after merging these 2 sorted arrays with same size. Problem Description This C Program finds median of the elements after merging 2 sorted arrays with same size. Problem Solution Prints the median of the elements after merging these 2 sorted arrays with a … Read more

advertisement

C Program to Find Ceiling and Floor Value of Sorted Array

This C Program calculates ceiling & floor of X given a sorted array & a value X. Here is source code of the C Program to calculate ceiling & floor of X given a sorted array & a value X. The C program is successfully compiled and run on a Linux system. The program output … Read more

advertisement

C Program to Search an Element in an Array

This is a C Program to read an array and search for an element. Problem Description This program will implement a one-dimentional array, take a number form users to search for in the array using Binary Search. Problem Solution 1. Create an array of some certain size and define its elements in sorted fashion. 2. … 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.