# Topic:interview

### Wildcard Pattern Matching using Dynamic Programming

Wildcard Pattern Matching - Given a text of length n and a wildcard pattern of length m, we are supposed to find whether the wildcard pattern matches the actual string. The pattern will consist of 2 wildcard character '?' and...

### DP – Coin Change: Find number of ways of representing n cents

Given an infinite supply of 25 cents, 10 cents, 5 cents, and 1 cent. Find the number of ways of representing n cents. (The order doesn’t matter). This is a coin change problem and will require the implementation of...

### Inorder Successor of a Node in Binary Search Tree

Given a pointer to a node of a Binary Search Tree(BST), we have to find the next node, which is the Inorder successor of the given node (assume a pointer to a parent node is already given).

### Check if a Binary Tree is a Binary Search Tree

Given a Binary Tree, we have to validate whether it is a valid Binary Search Tree(BST) or not. Print true, if given Binary Tree is a valid BST else print false. Let's understand this problem better with an example ...

### Design an algorithm to create a linked list of all the nodes at each depth

Given a binary tree, we have to design an algorithm that will create a linked list of all the nodes at each depth or level. For example, if we have a tree with depth D, then there...

### Sieve of Eratosthenes

Sieve of Eratosthenes is an algorithm to find all prime numbers up to a given range. This concept is very important when it comes to competitive programming because it is the most efficient way to find all primes smaller...

### Print all possible combinations of balanced valid parenthesis

We have to write an algorithm to print all possible combinations of the balanced valid parenthesis for n pairs of parenthesis. A valid parenthesis is one that is properly opened and closed. Example->  n...

### Print all unique permutations of a string with duplicate characters

A permutation is an act of rearranging or reordering elements of a set or string uniquely etc.For n elements, n! (n factorial) permutations are possible if there is no repetition.For n elements, permutations are possible, where ak represents the... 