Java Interview Report
- 0of 0 votes
AnswersYou are given the Ancestor matrix of a Binary tree, write an C program/function to construct the corresponding tree.
- Poornima April 28, 2015 in United States
For example, the below tree:
10
/ \
5 30
/ \ \
4 8 40
/
1
Will have the following ancestor Matrix
1 4 5 8 10 30 40
1 0 1 1 0 1 0 0
4 0 0 1 0 1 0 0
5 0 0 0 0 1 0 0
8 0 0 1 0 1 0 0
10 0 0 0 0 0 0 0
30 0 0 0 0 1 0 0
40 0 0 0 0 1 1 0
Essentially, in the ancestor matrix, each node has a row and a column (may not be the same). The value at a[i][j] will be 1 iff node of Node representing j‘th column is the ancestor of node representing the i‘th row.
Write an C program/function that can construct the binary tree from a given Ancestor matrix(2 dimensional array as input to the function).| Report Duplicate | Flag | PURGE
Java - 1of 1 vote
AnswersThe prime numbers between 1,000,000 and 1,000,100 are:
- Poornima April 28, 2015 in United States
1000003, 1000033, 1000037,1000039, 1000081, 1000099
and its sum is = 6000292.
What is the sum of all prime numbers between 1,000,000,000,000 and 1,000,000,100,000?| Report Duplicate | Flag | PURGE
Java