sanjos
BAN USER
- 0of 0 votes
AnswersGiven 2 trees T1 & T2 (both can have > 2 childs), write an algorithm to find if T2 is a subtree of T1.
- sanjos in United States
Follow up question, for any branch in T1
a->b->c->d
the following is a valid branch in tree T2(i.e. the isSubTree() algorithm mush evaluate to true in below circumstances)
a->d
a->c->d
c->d| Report Duplicate | Flag | PURGE
Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersGiven a list of sorted lists each of size maximum size M, implement an iterator (maintain the order of items as in the original list of lists).
- sanjos in United States
I had a solution requiring extra space using minHeap; However, the interviewer was looking for a constant space solution.| Report Duplicate | Flag | PURGE
Microsoft Software Developer Algorithm - 0of 0 votes
AnswersGiven multiple input streams of sorted numbers of infinite size, produce a single sorted output stream.
- sanjos in United States
(The size of all the input streams are unknown)
For eg.
Input Stream 1: 2,4,5,6,7,8...........
Input Stream 2: 1,3,9,12..............
Input Stream 3: 10,11,13,14........
Output Stream:
1,2,3,4,5,6,7,8,9,10,11,12,13...............| Report Duplicate | Flag | PURGE
Amazon SDE-3 Data Structures
private static int findNextInteger(int[] arr) {
if (arr == null || arr.length == 0)
return 0;
int number = 0;
// 10^2*1+10^1*2+10^0*3 = 100+20+3 = 234
for (int i = arr.length - 1, j = 0; i >= 0 && j <= arr.length - 1; i--, j++) {
number = number + (int) (Math.pow(10, i) * arr[j]);
}
return (number+1);
}
RepTinaaJohn, Cloud Support Associate at AMD
Hi,Everyone.I am an art teacher at Woodson Institute.Foster and encourage critical thinking and analysis about art and ...
Repsherrifjenkins, Applications Developer at ASAPInfosystemsPvtLtd
I am Sherri from Richmond USA. I am working as a Clinical laboratory technician worker in P. Samuels Men's ...
Repmelodyakeel, Consultant at Progress
Hello I am Melody. I am working as Human resource clerks, also called human resource assistants. I can maintain employee ...
Reparlenekraft8, How to book a seat on Southwest airlines flight at Absolute Softech Ltd
I am a coding specialist from MD,USA.I’m indifferent to most items on the planet.Participated in creating ...
Repbrandysolsen, Area Sales Manager at AMD
I am a Social butterflies who enjoy travel.Have fun doing this job and project an atmosphere that reflects Amazon ...
RepShirleyCWest, Software Engineer at Agilent Technologies
Hello, me Shirley and I from Savage. I am an artist and I love to doing art and I am ...
Repmanueladturner, Associate at Accenture
I am a content writer with years of successful track record of writing concise and fact-filled content on different topics ...
Repmadan@kukooo.in, Analyst at Absolute Softech Ltd
I am a content writer with years of successful track record of writing concise and fact-filled content on different topics ...
RepMaryLopal, Applications Developer at Coupondesh
I am a 41 year old dermatologist in Saginaw USA. I do like to face the challenges . I'm active ...
What's the space complexity of this algo according to you? I was asked to submit something with O(1) space complexity.
- sanjos February 11, 2019