Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
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...
Binary Search Tree Amazon Google

Find k-th smallest element in BST (Order Statistics in BST)

Given root of binary search tree and K as input, find K-th smallest element in BST. For example, in the following BST, if k = 3, then output should be 10, and if k =...
Binary Search Tree Stack Tree

Construct BST from given preorder traversal Set 2

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 the output should be root of f...
Binary Search Tree Binary Search Tree

Floor and Ceil from a BST

There are numerous applications we need to find floor (ceil) value of a key in a binary search tree or sorted array. For example, consider designing memory manag...
Binary Search Tree Amazon BST

Convert a BST to a Binary Tree such that sum of all greater keys is added to every key

Given a Binary Search Tree (BST), convert it to a Binary Tree such that every key of the original BST is changed to key plus sum of all greater keys in BST. Example...
C C++ C-Library

Substring in C++

In C++, std::substr() is a predefined function used for string handling. string.h is the header file required for string functions. This function takes two values po...
C++ cpp-class CPP

Abstraction in C++

Data abstraction is one of the most essential and important feature of object oriented programming in C++. Abstraction means displaying only essential information an...
C++ School Programming cpp-inheritance

Pure Virtual Functions and Abstract Classes in C++

Sometimes implementation of all function cannot be provided in a base class because we don’t know the implementation. Such a class is called abstract class. ...
Dynamic Programming Strings Accolite

Longest Palindromic Substring Set 1

Given a string, find the longest substring which is palindrome. For example, if the given string is “forgeeksskeegfor”, the output should be “g...
Dynamic Programming Strings Microsoft

Longest Common Substring DP-29

Given two strings ‘X’ and ‘Y’, find the length of the longest common substring. Examples : Input : X = “GeeksforGeeks”, ...

Subscribe to Our Newsletter