## Subarray Inversions

We have an array A of n integers that we’re planning on sorting. Specifically, we want to know how close the array is to sorted.… Read More »

We have an array A of n integers that we’re planning on sorting. Specifically, we want to know how close the array is to sorted.… Read More »

Veritas visited our college for campus hiring. The CTC offered was 9.26 LPA. There were a total of 105 candidates eligible for the recruitment test.… Read More »

This a common question asked in DS interviews that despite of better worst case performance of merge sort, quicksort is considered better than mergesort. There… Read More »

Given two Linked Lists, create union and intersection lists that contain union and intersection of the elements present in the given lists. Order of elements… Read More »

Senior android Developer Coding Round: Spirally traversing a matrix Longest Increasing Subsequence First Round: find “longest line” of 1’s in array. Hoizontal and Vertical. Array… Read More »

Given two sorted arrays, the task is to merge them in a sorted manner. Examples: Input: arr1[] = { 1, 3, 4, 5}, arr2[] =… Read More »

TimSort is a sorting algorithm based on Insertion Sort and Merge Sort. A stable sorting algorithm works in O(n Log n) time Used in Java’s… Read More »

Given a permuted array of length N of first N natural numbers, we need to tell the minimum number of swaps required in the sorted… Read More »

Given an array of integer values which need to be sorted by only one operation – subarray rotation where subarray size should be 3. For… Read More »

Given an integer array of which both first half and second half are sorted. Task is to merge two sorted halves of array into single… Read More »

Online test: Coding : Time : 90 minutes There were three coding questions as follows: A man starts from his house with a few pan… Read More »

Given a number ‘n’ and a n numbers, sort the numbers using Concurrent Merge Sort. (Hint: Try to use shmget, shmat system calls). Part1: The… Read More »

Some of the merge operation classes are provided in C++ STL under the header file “algorithm”, which facilitates several merge operations in a easy manner.… Read More »

A surpasser of an element of an array is a greater element to its right, therefore x[j] is a surpasser of x[i] if i <… Read More »

We have discussed sorting weapons used by different languages in previous article. In this article, C++’s Sorting Weapon, Introsort is discussed. What is Introsort? Simply… Read More »