Couple of years ago when me and my friends appeared for campus interviews in IITs, NITs and BITs we faced many challenging interview questions like N petrol bunks arranged in a city, Sort Stack … Read More
Difference between a LinkedList and a Binary Search Tree BST
Pointers
In a linked list, the items are linked together through a single next pointer.
Next Nodes
In a binary tree, each node can have 0, 1 or 2 subnodes, where (in case of a … Read More
Binary Tree in Java
How to write Binary Search Tree Code in Java with proper class structure and methods.
Here is the implementation of Binary Search Tree in Java.
Class Structure, Get Set Methods, Binary Tree Operation, Pre-Post-InOrder code … Read More
K’th Largest Element in BST when modification to BST is not allowed
Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.
Count number of ways to reach a given score in a game
Consider a game where a player can score 3 or 5 or 10 points in a move. Given a total score n, find number of ways to reach the given score.Examples:
Input: n = 20
… Read More Input: n = 20
Daughter’s Age VeryGood Puzzle
Hello folks,Today I am posting an Interview Puzzle which was asked to my friend in his Interview. This puzzle will be helpful in job interview preparation.
… Read More I have also posted many puzzles for interview before,
SAP Interview Questions
In SAP Interview, Questions are pretty simple and straight forward, easy to code but they ask you to write proper unit test cases and they check if you have handles all edge cases or not.… Read More