Tutorialspoint.dev
Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Arrays Backtracking Hash

Given an array A[] and a number x, check for pair in A[] with sum as x

Write a program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in S whose sum is exactly x. ...
Matrix Stack Amazon

The Celebrity Problem

In a party of N people, only one person is known to everyone. Such a person may be present in the party, if yes, (s)he doesn’t know anyone in the party. We can...
Arrays Linked List Accolite

Add two numbers represented by linked lists Set 2

Given two numbers represented by two linked lists, write a function that returns sum list. The sum list is linked list representation of addition of two input numbers...
Queue Recursion Stack

Level order traversal in spiral form

Write a function to print spiral order traversal of a tree. For below tree, function should print 1, 2, 3, 4, 5, 6, 7. Recommended: Please solve it on “PRAC...
Greedy Activity Selection Problem Amazon

Activity Selection Problem Greedy Algo-1

Greedy is an algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit. Greedy...
Backtracking Matrix Amazon

Rat in a Maze Backtracking-2

We have discussed Backtracking and Knight’s tour problem in Set 1. Let us discuss Rat in a Maze as another example problem that can be solved using Backtracki...
Backtracking Matrix Amazon

Sudoku Backtracking-7

Given a partially filled 9×9 2D array ‘grid[9][9]’, the goal is to assign digits (from 1 to 9) to the empty cells so that every row, column, and s...
Hash Linked List Python

Find the first non-repeating character from a stream of characters

Given a stream of characters, find the first non-repeating character from stream. You need to tell the first non-repeating character in O(1) time at any moment. If we...
Arrays Searching Adobe

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 at some pivot unknown to you befo...
Arrays Queue Amazon

Sliding Window Maximum (Maximum of all subarrays of size k)

Given an array and an integer k, find the maximum for each and every contiguous subarray of size k. Examples : Input : arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6} k = 3 Outp...

Subscribe to Our Newsletter