Check if a Binary tree is sub-tree of another

Given pointers to the root of two Binary Trees, write code to check if first Binary tree is subtree of second binary tree. The signature (prototype) of the function should be /** returns 1 (true) if Binary Tree a is subtree of Binary tree b , * else returns 0(false) */ int checkSubTree(struct Node* a, […]

Invert traingle made from 6 circles

Given 6 circles which are arranged in the form of a triangle as shown below ° ° ° ° ° ° You are supposed to invert the triangle and want to move minimum circles. At least how many circles do you need to move to invert the above triangle as below ° ° ° ° […]

Computing average of stream of numbers

Given a stream of numbers (keep reading numbers from the keyboard). Write code to print the average at each point. For example: user is entering the numbers, at each point you should print the average of all the numbers entered till now, as shown below numbers             Average ————        ————- 10                    10 10, […]

Delete alternate node of the linked list

Given a linked list. Write code to delete alternate nodes from the list. For example: If the list given is 2 -> 3 -> 5 -> 1 -> 4 -> 8 The result should be 2 -> 5 -> 4

Recursive function to compute sum of digis in a number

Write a function which should accept an integer and should return the sum of digits in that integer. This function should compute the sum of digits recursively. For example: Input      Output ——–         ———– 56          11 (5+6) 1234        10 (1+2+3+4)