Java program to check if a binary tree is BST or not – A binary search tree (BST) is a node based binary tree data structure.
Algorithm
Given two positive integers n and k, print all increasing sequences of length k such that the elements in every sequence are from first n natural numbers.
Given two strings str1 and str2, find if str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting
Given two strings str1 and str2, find if str1 is a subsequence of str2. A subsequence is a sequence that can be derived from another sequence by deleting
Given a snake and ladder board, find the minimum number of dice throws required to reach the destination or last cell from source or 1st cell.
This is mainly an application of Catalan Numbers. Total possible valid expressions for input n is n/2’th Catalan Number if n is even and 0 if n is odd.
Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD.
C++ Programming – Program to evaluate simple expressions – Algorithm – string that represent an expression of digits and operands. E.g. 1+2*3, 1-2+4.
C++ Programming – Rearranged to form a palindrome – Algorithm – Given a string, if characters of the given string can be rearranged to form a palindrome.