C Program to Find K Closest Median Elements

This is a C Program to find k numbers cloest to median of S, S being a set of n numbers. Here is source code of the C Program to Find k Numbers Closest to Median of S, Where S is a Set of n Numbers. The C program is successfully compiled and run on … Read more

advertisement

C Program to Find Median of Two Arrays of Different Sizes

This is a C Program to find median of elements where elements are stored in two different arrays. Here is source code of the C Program to Find Median of Elements where Elements are Stored in 2 Different Arrays. The C program is successfully compiled and run on a Linux system. The program output is … Read more

advertisement

C Program to Perform Finite State Automaton based Search

This is a C Program to search a string using finite automata. Given a text txt[0..n-1] and a pattern pat[0..m-1], write a function search(char pat[], char txt[]) that prints all occurrences of pat[] in txt[]. You may assume that n > m. Here is source code of the C Program to Perform Finite State Automaton … Read more

advertisement

C Program to Implement Linear Search using Recursion

This is a C Program to implement Linear Search Algorithm using Recursion. Problem Description We have to create a C Program which finds the position of an element in an array using Linear Search Algorithm using Recursion. Expected Input and Output 1. Average Case : On an average, linear search takes O(n) comparisons to find … Read more

advertisement

C Program to Find Maximum Element in an Array using Binary Search

This C program finds maximum element in an array using Binary Search. In binary search we prune half the search state space by selecting either one of the partition. The primary condition is that the sequence should be sorted. Here is the source code of the C program to search an integer array using binary … Read more

advertisement

C Program to Perform Searching using Self-Organizing Lists

This C program performs searching using self-organizing lists. A self-organizing list is a list that reorders its elements based on some self-organizing heuristic to improve average access time. The aim of a self-organizing list is to improve efficiency of linear search by moving more frequently accessed items towards the head of the list. A self-organizing … Read more

advertisement

C Program to Find Second Smallest of n Elements with Complexity Constraint

This C program finds second smallest of n Elements in an array. Given an array of n Integers, this algorithm finds the second smallest element out of it. Here is the source code of the C program to find the second smallest number. The C program is successfully compiled and run on a Linux system. … Read more

advertisement

C Program to Compare Binary and Sequential Search

This C program compares two searching algorithms – Binary and Sequential Search. Sequential search is used to find a key in a randomly arranged array. Searching time is O(n). Binary search on the other hand is implemented in a sorted array and is much faster than linear search. Its time complexity is O(log(n)). Here is … Read more

advertisement

C Program to Find Minimum Element in an Array using Linear Search

This is a C Program to implement Linear Search Algorithm to find the minimum element in an array. Problem Description We have to create a C Program which finds the minimum element in an array using Linear Search Algorithm. We have to create a linear search function which will have array and its size as … Read more

advertisement

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
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 & technical discussions at Telegram SanfoundryClasses.