Tag Archives: D-E-Shaw

Queue using Stacks

The problem is opposite of this post. We are given a stack data structure with push and pop operations, the task is to implement a… Read More »

Level Order Tree Traversal

Level order traversal of a tree is breadth first traversal for the tree. Level order traversal of the above tree is 1 2 3 4… Read More »

Write a function to get the intersection point of two Linked Lists

There are two singly linked lists in a system. By some programming error, the end node of one of the linked list got linked to… Read More »

Median of two sorted arrays of same size

There are 2 sorted arrays A and B of size n each. Write an algorithm to find the median of the array obtained after merging… Read More »

Given a string, find its first non-repeating character

Given a string, find the first non-repeating character in it. For example, if the input string is “GeeksforGeeks”, then the output should be ‘f’ and… Read More »

Search an element in a sorted and rotated array

An element in a sorted array can be found in O(log n) time via binary search. But suppose we rotate an ascending order sorted array… Read More »

Largest Sum Contiguous Subarray

Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum. Recommended: Please solve… Read More »

Majority Element

Write a function which takes an array and prints the majority element (if it exists), otherwise prints “No Majority Element”. A majority element in an… Read More »