CODING
SYSTEM DESIGN
PLACEMENT PREP.
BLOG
LOGIN/REGISTER
MY ACCOUNT
LOGOUT
Print all repeating characters in a string
We have already seen the problem to print first repeating character in a string. In this post we will be looking at printing all the
[…]
Print the first repeating character in String
Give a string in which characters may be repeating. Print the first character (from the start) which is repeating in the string. For example: String:
[…]
Recursive function to reverse a String
We have already seen the problem to reverse the words in a string, in the solution to that problem we have also written function to reverse
[…]
Check if one string is rotation of another
Given two strings, write code to check if one string is rotation of another. For example: str2 below is a rotation of str1. str1 =
[…]
Find height of the Binary Tree
Given a Binary Tree, write code to calculate the height of the tree. Height of the binary Tree is the total number of levels in
[…]
Level of node in a Binary Tree
Given a Binary Tree and a pointer to the Node in that tree. Write a function to find level of Node in the Tree. For
[…]
Node with maximum value in a Binary search tree
Earlier, we have seen how to find the minimum element in a Binary Search Tree. Write a function which will return the maximum value in
[…]
Similar Trees
Write function to check whether two trees are similar or not. The signature of the function should be as shown below: /** * Function to
[…]
deleting a tree
Given a binary tree, write code to delete the entire tree. Structure of the node is as given below: struct Node { int data; Node*
[…]
Find kth element in union of two arrays
Given two sorted arrays of size m and n respectively. Find the kth element in the merged result of A and B. For example, If the inputs (A, B
[…]
Load more