Pergunta de entrevista da empresa Apple

Print out, from small to big, of a sequence intergers, without sorting.

Respostas da entrevista

Sigiloso

22 de set. de 2013

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

1

Sigiloso

6 de dez. de 2015

Construct binary search tree and do inorder traversal.

1

Sigiloso

18 de fev. de 2019

Use a visited array. Run n passes on the given array picking smallest integer every time that has not been visited yet

Sigiloso

11 de out. de 2012

priority queue then

4

Sigiloso

8 de abr. de 2013

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

2

Sigiloso

13 de set. de 2013

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

3