Given a matrix of dimension M * N filled with values 0 (Cell that can be visited), 1 (Starting point), and 2 (Cell that cannot… Read More
Tag Archives: Algorithms-Searching
Given two strings s and t, the task is to remove all occurrences of t in s and return the modified string s, and you… Read More
N-Base modified Binary Search is an algorithm based on number bases that can be used to find an element in a sorted array arr[]. This… Read More
Given a Doubly linked list(DLL) containing N nodes and an integer X, the task is to find the position of the integer X in the… Read More
Prerequisite: Searching and Sorting Algorithms Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is… Read More
A linear search or sequential search is a method for finding an element within a list. It sequentially checks each element of the list until… Read More
Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored. Based on the type… Read More
Given an array arr[] having N integers and an integer K, the task is to select K elements from the given array such that the… Read More
Given an array arr[] and a number K, where K is smaller than the size of the array, we need to find the Kth smallest… Read More
Given an array A[] of size N with entries as integers, some of the entries are -1. The task is to replace -1’s with numbers… Read More
Given N rows with M elements each and an array arr[] of L numbers, the task is to print the count of elements of that… Read More
You are given a list of 5 integers and these integers are in the range from 1 to 6. There are no duplicates in list.… Read More
C++ 1. f(int Y[10], int x) { 2. int i, j, k; 3. i = 0; j = 9; 4. do { 5. k = … Read More
Consider the following C program that attempts to locate an element x in an array Y[] using binary search. The program is erroneous. (GATE CS… Read More
Given a sorted array of integers, what can be the minimum worst-case time complexity to find ceiling of a number x in given array? The… Read More