Skip to content
We have discussed assignment operator overloading for dynamically allocated resources here . This is a an extension of the previous post. In the previous post,… Read More
Given a string, find the longest substring which is palindrome.  For example,  Input: Given string :"forgeeksskeegfor", Output: "geeksskeeg" Input: Given string :"Geeks", Output: "ee" Recommended:… Read More
# Python program for implementation of Quicksort     # This function is same in both iterative and recursive def partition(arr,l,h):     i = ( l -… Read More
// Java implementation of iterative quick sort class IterativeQuickSort {     void swap(int arr[], int i, int j)     {         int t = arr[i];         arr[i] = arr[j];… Read More
// An iterative implementation of quick sort #include <stdio.h>    // A utility function to swap two elements void swap(int* a, int* b) {     int… Read More
Following is a typical recursive implementation of Quick Sort that uses last element as pivot.   C++ // CPP code for recursive function of Quicksort #include… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> using namespace std;    class A {     public:     A& operator=(const A&a)     {         cout <<… Read More
Given an unsorted array of positive integers, find the number of triangles that can be formed with three different array elements as three sides of… Read More
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
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
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
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
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
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 tree… Read More
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