Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Heap Mathematical Adobe

Median in a stream of integers (running integers)

Given that integers are read from a data stream. Find median of elements read so for in efficient way. For simplicity assume there are no duplicates. For example, let...
Binary Search Tree Tree Accolite

A program to check if a binary tree is BST or not

A binary search tree (BST) is a node based binary tree data structure which has the following properties. • The left subtree of a node contains only nodes with...
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...
Tree Accolite Adobe

Root to leaf path sum equal to a given number

Given a binary tree and a number, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals the given number. Return fa...
Tree Adobe Amazon

Check if a given Binary Tree is SumTree

Write a function that returns true if the given Binary Tree is SumTree else false. A SumTree is a Binary Tree where the value of a node is equal to sum of the nodes p...
Dynamic Programming Adobe Amazon

Partition problem DP-18

Partition problem is to determine whether a given set can be partitioned into two subsets such that the sum of elements in both subsets is same. Examples: arr[] = {1...
Arrays Dynamic Programming Adobe

Subset Sum Problem DP-25

Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with sum equal to given sum. Example: Input: set[] = {3, 34, ...
Graph Greedy Adobe

Dijkstra’s shortest path algorithm Greedy Algo-7

Given a graph and a source vertex in the graph, find shortest paths from source to all vertices in the given graph. Dijkstra’s algorithm is very similar to Pr...
Backtracking Adobe Amazon

Subset Sum Backtracking-4

Subset sum problem is to find subset of elements that are selected from a given set whose sum adds up to a given number K. We are considering the set contains no...
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...

Subscribe to Our Newsletter