Skip to content

Category Archives: C# Programs

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… Read More
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… Read More
Given a binary matrix, find out the maximum size square sub-matrix with all 1s. For example, consider the below binary matrix. Recommended: Please solve it… Read More
Inversion Count for an array indicates – how far (or close) the array is from being sorted. If the array is already sorted, then the… Read More
There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained merging the… Read More
Write an efficient program to count number of 1s in binary representation of an integer. Examples : Input : n = 6 Output : 2… Read More
A permutation also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with… Read More
Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers that has the largest sum.    Recommended: Please… Read More
Given an array of positive integers. All numbers occur even number of times except one number which occurs the odd number of times. Find the… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :   Input : n = 4 Output… Read More

Start Your Coding Journey Now!