# Category Archives: Algorithms

Given a positive integer, write a function that returns true if the given number is a palindrome, else false. For example, 12321 is a palindrome,… Read More
Given a number N having only one ‘1’ and all other ’0’s in its binary representation, find position of the only set bit. If there… Read More
Standard C library provides qsort() that can be used for sorting an array. As the name suggests, the function uses QuickSort algorithm to sort the… Read More
Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values… Read More
Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values… Read More
Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values… Read More
Heap sort is a comparison-based sorting technique based on Binary Heap data structure. It is similar to the selection sort where we first find the… Read More
Heap sort is a comparison-based sorting technique based on the Binary Heap data structure. It is similar to the selection sort where we first find… Read More
Heap sort is a comparison-based sorting technique based on the Binary Heap data structure. It is similar to the selection sort where first find the… Read More
Pre-requisite: What is Heap Sort? Heapsort is a comparison-based sorting technique based on a Binary Heap data structure. It is similar to selection sort where… Read More
You are given a one dimensional array that may contain both positive and negative integers, find the sum of contiguous subarray of numbers which… Read More
Merge sort is defined as a sorting algorithm that works by dividing an array into smaller subarrays, sorting each subarray, and then merging the sorted… Read More
Given a set of n integers, divide the set in two subsets of n/2 sizes each such that the absolute difference of the sum of… Read More
Insertion sort is an algorithm used to sort a collection of elements in ascending or descending order. The basic idea behind the algorithm is to… Read More
Insertion sort is a simple sorting algorithm that works similar to the way you sort playing cards in your hands. The array is virtually split… Read More