Microsoft Interview Report
- 0of 0 votes
AnswersGiven a very very long linked list with 'n' nodes.
- Abhinav May 19, 2010
Also given a positive integer 't'>1.
Delete every 't'th node. In the resultant linked list, again delete 't'th node. Repeat this till only t-1 nodes remains.
Find the node.
Eg:
Linked list : 10->20->30->40->50->60->70
n = 7
t = 3
Phase 1:
10->20->40->50->70
Phase-2:
10->20->50->70
Phase-3:
10->20->70
Phase-4:
10->20
Simple solution with many traversals is obvious.
Is there a solution with one traversal or O(n)?
b) Similar for circular linked list.
Keep deleting 't'th node till 1 node remains.
Note here not till 't-1' nodes but till 1 node remains.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test Algorithm C Coding - 0of 0 votes
AnswersGiven an array , delete all duplicates in it.
- Abhinav May 19, 2010| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test - 0of 0 votes
AnswersTwo unsorted linked lists are given.
- Abhinav May 19, 2010
Find the union.
Eg: a) 1->9->9->5->7->8->9->7
b) 44->33->1->9->55
Result:
1->9->5->7->8->44->33->55
The elements in the result can be in any order| Report Duplicate | Flag | PURGE
Microsoft Software Engineer in Test