Drishti-Soft Interview Questions


Array Questions Drishti-Soft

Question 1. Subset Sum Problem in O(sum) space Problem Statement The “Subset sum in O(sum) space” problem states that you are given an array of some non-negative integers and a specific value. Now find out if there is a subset whose sum is equal to that of the given input value. Example Array = {1, 2, 3, 4} ...

Read more

Tree Questions Drishti-Soft

Question 2. BST to a Tree with Sum of all Smaller Keys In this problem we have given a Binary Search Tree, write an algorithm to convert best to a tree with sum of all smaller keys. Example Input Output Pre-order : 19 7 1 54 34 88 Naive Approach Traverse all the nodes one by one in any traversal form, and ...

Read more