## C++ Program for Comb Sort

Comb Sort is mainly an improvement over Bubble Sort. Bubble sort always compares adjacent values. So all inversions are removed one by one. Comb Sort… Read More »

- Count distinct elements in an array
- Print the nodes of binary tree as they become the leaf node
- Rearrange Odd and Even values in Alternate Fashion in Ascending Order
- Sort the array of strings according to alphabetical order defined by another string
- In-Place Merge Sort
- Ternary Search
- Number of pairs whose sum is a power of 2
- Merge K sorted arrays | Set 3 ( Using Divide and Conquer Approach )
- Minimum Increment / decrement to make array elements equal
- Smallest subarray containing minimum and maximum values
- Check if array can be sorted with one swap
- Find closest value for every element in array
- Check if it is possible to sort the array after rotating it
- Print array elements in alternatively increasing and decreasing order
- Merge K sorted arrays of different sizes | ( Divide and Conquer Approach )
- Internal details of std::sort() in C++
- Sort the array in a given index range
- Maximum sum by picking elements from two arrays in order
- Array element with minimum sum of absolute differences
- Sort only non-prime numbers of an array in increasing order
- Check if the characters of a given string are in alphabetical order
- Largest element in the array that is repeated exactly k times
- Sort an array of string of dates in ascending order
- Average of remaining elements after removing K largest and K smallest elements from array
- K-th lexicographically smallest unique substring of a given string
- Python | Sort list of list by specified index
- Check if words are sorted according to new order of alphabets
- Minimum number of bottles required to fill K glasses
- Make palindromic string non-palindromic by rearranging its letters
- Rearrange an array to maximize i*arr[i]

Comb Sort is mainly an improvement over Bubble Sort. Bubble sort always compares adjacent values. So all inversions are removed one by one. Comb Sort… Read More »

Given an array of strings arr[]. Sort given strings using Bubble Sort and display the sorted array. In Bubble Sort, the two successive strings arr[i]… Read More »

We are given two sorted array. We need to merge these two arrays such that the initial numbers (after complete sorting) are in the first… Read More »

ROUND 1: First round was aptitude round, 10 question in 30 minute. Level of difficulty: easy. For each correct answer 2 marks will be awarded… Read More »

I recently interviewed for Visa Inc. on our campus. Coding Test: Platform: Hackerrank Questions: https://www.geeksforgeeks.org/find-number-of-islands/ https://www.geeksforgeeks.org/maximum-profit-by-buying-and-selling-a-share-at-most-twice/ I dont remember the other two (PS: they were… Read More »

I attended a Paytm recruitment drive. The requirement was for both Front-end and Backend Developers. I applied for Backend. First there was a written round.… Read More »

Round -1(written) 20 Online MCQ topics are c, Data Structure and Algorithms, Networks, DBMS,OS Round 1(F2F) [1.5 hr] Introduce yourself. 1) Sort array [0,1,1,1,1,0,0,1] do… Read More »

Given an array of dates, how to sort them. Example: Input: Date arr[] = {{20, 1, 2014}, {25, 3, 2010}, { 3, 12, 1676}, {18,… Read More »

An article containing recent Directi programming round questions in my campus placements and also those in my friends’ colleges. 1) You are given a string… Read More »

filter_none edit close play_arrow link brightness_4 code // C++ program for sorting dates using selectio0n sort #include<bits/stdc++.h> using namespace std; struct date { int day;… Read More »

In simple QuickSort algorithm, we select an element as pivot, partition the array around pivot and recur for subarrays on left and right of pivot.… Read More »

I recently had interviews with Amazon.com, Bangalore. Here’s my interview experience Written round: 1) Insert a number at its correct position in a sorted circular… Read More »

Given an array of integers, find the length of the longest sub-sequence such that elements in the subsequence are consecutive integers, the consecutive numbers can… Read More »

Given a Linked List. The Linked List is in alternating ascending and descending orders. Sort the list efficiently. Example: Input List: 10->40->53->30->67->12->89->NULL Output List: 10->12->30->43->53->67->89->NULL… Read More »

Consider a big array where elements are from a small set and in any range, i.e. there are many repetitions. How to efficiently sort the… Read More »