## Construct BST from given preorder traversal | Set 1

Given preorder traversal of a binary search tree, construct the BST. For example, if the given traversal is {10, 5, 1, 7, 40, 50}, then… Read More »

## Shuffle a given array using Fisher–Yates shuffle Algorithm

Given an array, write a program to generate a random permutation of array elements. This question is also asked as “shuffle a deck of cards”… Read More »

## Print all permutations in sorted (lexicographic) order

Given a string, print all permutations of it in sorted order. For example, if the input string is “ABC”, then output should be “ABC, ACB,… Read More »

## Lexicographic rank of a string

Given a string, find its rank among all its permutations sorted lexicographically. For example, rank of “abc” is 1, rank of “acb” is 2, and… Read More »

## Construct Full Binary Tree from given preorder and postorder traversals

Given two arrays that represent preorder and postorder traversals of a full binary tree, construct the binary tree. A Full Binary Tree is a binary… Read More »

## Adobe Interview | Set 2

I have recently been through the recruitment process of ADOBE. I didn’t get through (I got the reply today), but I sincerely hope that my… Read More »

## When should we write our own assignment operator in C++?

The answer is same as Copy Constructor. If a class doesn’t contain pointers, then there is no need to write assignment operator and copy constructor.… Read More »

## Find the element that appears once

Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once. Expected time complexity… Read More »

Predict the output of following C++ program. filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std;    class Test { protected:     int x;… Read More »

## Find the largest multiple of 3 | Set 1 (Using Queue)

Given an array of non-negative integers. Find the largest multiple of 3 that can be formed from array elements. For example, if the input array… Read More »

## Check divisibility by 7

Given a number, check if it is divisible by 7. You are not allowed to use modulo operator, floating point arithmetic is also not allowed.… Read More »

## Flattening a Linked List

Given a linked list where every node represents a linked list and contains two pointers of its type: (i) Pointer to next node in the… Read More »

## Microsoft Interview | Set 8

This about my experience of MS interview, which happened last day Division: Microsoft Bing R&D Rounds: Total 4 rounds (All face to face) Location: Hyderabad.… Read More »

## Print unique rows in a given boolean matrix

Given a binary matrix, print all unique rows of the given matrix. Example: Input: {0, 1, 0, 0, 1} {1, 0, 1, 1, 0} {0,… Read More »

## Median of two sorted arrays of different sizes

This is an extension of median of two sorted arrays of equal size problem. Here we handle arrays of unequal size also. Method 1: (Linear… Read More »