All Medium Articles

## Iterative Postorder Traversal | Set 1 (Using Two Stacks) 3

We have discussed iterative inorder and iterative preorder traversals. In this post, iterative postorder traversal is discussed, which is more complex than the other two… Read More »

## Flatten a multilevel linked list 3.3

Given a linked list where in addition to the next pointer, each node has a child pointer, which may or may not point to a… Read More »

## Algorithms | Analysis of Algorithms | Question 17 3

Let s be a sorted array of n integers. Let t(n) denote the time taken for the most efficient algorithm to determined if there are… Read More »

## Data Structures | Linked List | Question 10 3.5

Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality will be… Read More »

## Microsoft Interview | 15 3

I recently had interview with Microsoft and i have been selected. I am really thankful to geeksforgeeks site which provides preparation material for technical interviews… Read More »

## Amazon Interview | Set 21 3

Recently I have gone through 10 rounds of interviews of my dream company Amazon for SDE1 and I got selected. My only resource and library… Read More »

## Data Structures | Stack | Question 8 3.3

A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top2 (topl<… Read More »

## Algorithms | Analysis of Algorithms (Recurrences) | Question 8 3

What is the time complexity of the following recursive function: filter_none edit close play_arrow link brightness_4 code int DoSomething (int n)  {   if (n <=… Read More »

## Data Structures | Binary Trees | Question 9 3

A weight-balanced tree is a binary tree in which for each node. The number of nodes in the left sub tree is at least half… Read More »

## Arrange given numbers to form the biggest number | Set 1 3.1

Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548,… Read More »

## Amazon Interview | Set 20 3

Recently got interviewed with amazon Hyderabad for SDE1. Written 1) Given a BST, along with left and right pointer for a node, it has forward… Read More »

## Data Structures | Heap | Question 4 3

Suppose the elements 7, 2, 10 and 4 are inserted, in that order, into the valid 3- ary max heap found in the above question,… Read More »

## C | Arrays | Question 4 3.5

Output of following program? filter_none edit close play_arrow link brightness_4 code #include<stdio.h>       int main()  {    int a[] = {1, 2, 3, 4, 5, 6}; … Read More »

## Largest Independent Set Problem | DP-26 3.4

Given a Binary Tree, find size of the Largest Independent Set(LIS) in it. A subset of all tree nodes is an independent set if there… Read More »

## Operating Systems | Input Output Systems | Question 2 3

We describe a protocol of input device communication below. a. Each device has a distinct address b. The bus controller scans each device in sequence… Read More »

## Find the first circular tour that visits all petrol pumps 3.6

Suppose there is a circle. There are n petrol pumps on that circle. You are given two sets of data. The amount of petrol that… Read More »

## Algorithms | Sorting | Question 12 3.5

What is the worst case time complexity of insertion sort where position of the data to be inserted is calculated using binary search? (A) N… Read More »

## Algorithms | Sorting | Question 11 3.1

You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate? (A) Heap… Read More »

## C | Operators | Question 12 3.2

filter_none edit close play_arrow link brightness_4 code #include<stdio.h>  int main()  {    char *s[] = { “knowledge”,”is”,”power”};    char **p;    p = s;    printf(“%s “, ++*p);    printf(“%s… Read More »

## C | Storage Classes and Type Qualifiers | Question 6 3.5

filter_none edit close play_arrow link brightness_4 code #include<stdio.h> int main() {   typedef static int *i;   int j;   i a = &j;   printf(“%d”, *a);   return 0;… Read More »