Apple Interview Question: Print out, from small to big,... | Glassdoor

Interview Question

Senior Software Engineer Interview Cupertino, CA

Print out, from small to big, of a sequence intergers

  , without sorting.
Answer

Interview Answer

5 Answers

4

priority queue then

xpandan on Oct 11, 2012
2

The problem refers to dynamic programming, Longest increasing sequence in the given array. The time complexity of solution is o(n2).

Vishal Mandekar on Apr 7, 2013
1

Add the sequence of integers to HashSet, which will apply natural order and then print the collection elements.

nsp on Sep 13, 2013
0

If the integers are within a small range, then create an vector array, loop through all integers and flag the array. Then print out.

Peter on Sep 22, 2013
0

Construct binary search tree and do inorder traversal.

SB on Dec 5, 2015

Add Answers or Comments

To comment on this, Sign In or Sign Up.