## C++ Program to Implement Binary Search using Iteration

This is a C++ Program to implement Binary Search Algorithm. Problem Description We have to write a C++ Program which either finds the position of an element in an array or detects the presence of an element in an array using Binary Search Algorithm. Expected Input and Output Case 1. Average Case: When the element … Read more

## 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: When the element searched for is any random element in the … Read more

## C++ Program to Implement Linear Search

What is Linear Search? Linear search in C++ is a simple search algorithm used to find the position of a target element in an array by sequentially checking each element until a match is found or the end is reached. Problem Description Write a C++ Program that finds the position of an element in an … Read more

## C++ Program to Compare Binary and Sequential Search

C++ Program to Compare Binary and Sequential Search. Problem Description 1. Implement both binary and sequential search. 2. The time complexity of Binary search is O(log(n)). 3. The time complexity of Linear search is O(n). Problem Solution 1. Implement the binary search and count the number of iteration to compute the result. 2. Implement the … Read more

## C++ Program to Perform Searching using Self-Organizing Lists

C++ Program to implement Self-Organizing List. Problem Description 1. Self-Organizing list updates on the basis of last searched item. 2. The sequential searching approach is used. 3. In general search, 80% time only specific 20% of data is accessed. 4. This algorithm shifts the more important data to the beginning of the list. 5. The … Read more

## C++ Program to Find a Search Sequence using Binary Search

C++ Program to find a search sequence using Binary search. Problem Description 1. Implement binary search to find the existence of a search sequence in an array. 2. The time complexity of Binary search is O(log(n)). Problem Solution 1. Implement the binary search to find the first value of search sequence. 2. If it is … Read more

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

C++ Program to find second smallest of n elements with given complexity constraint. Problem Description 1. Traverse the data array linearly and find the second smallest element. 2. The time complexity of the algorithm is O(n). Problem Solution 1. Linearly traverse the data array. 2. Keep track of the smallest number. 3. Simultaneously keep updating … Read more

## C++ Program to Find K Closest Median Elements

This is a C++ Program to find k numbers closest to the median of S, Where S is a set of n numbers. Problem Description 1. We need to find k numbers which have a minimum difference with the median of the data set. 2. It includes sorting using quick sort and then printing k … Read more

## C++ Program to Find kth Largest Element in a Sequence

C++ Program to find Kth Largest Element in a Sequence. Problem Description 1. Extract the Kth largest element from a sequence. 2. By selectively sorting the array to get Kth largest element it has the complexity of O(k*n). 2. We can improve the time complexity by approaching the problem using max-heap. 3. The time complexity … Read more 