Category Archives: Sorting (adsbygoogle = window.adsbygoogle || []).push({});

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 »

Sorting Strings using Bubble Sort

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 »

Merge two sorted arrays with O(1) extra space

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 »

Zycus Interview Experience

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 »

Visa Interview Experience |Set 10 (On-Campus)

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 »

Paytm Interview Experience | Set 5 (Recruitment Drive)

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 »

Accolite Interview Experience | Set 8

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 »

How to sort an array of dates in C/C++?

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 »

Directi Interview | Set 7 (Programming Questions)

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 »

C++ program for Sorting Dates using Selection Sort

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 »

3-Way QuickSort (Dutch National Flag)

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 »

Amazon Interview Experience |Set 225 (For 1 Year Experienced)

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 »

Longest Consecutive Subsequence

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 »

Sort a linked list that is sorted alternating ascending and descending orders?

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 »

How to sort a big array with many repetitions?

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 »