Pergunta de entrevista da empresa AKUNA CAPITAL

Unusual sort: sort an array A such that: A[0]<A[1]>A[2]<A[3]>A[4]<A[5].............

Respostas da entrevista

Sigiloso

23 de dez. de 2019

Basic Coding

Sigiloso

13 de jul. de 2016

I think priority queue can do this

Sigiloso

5 de ago. de 2016

It's a wiggle sort question and can be solved in 4-line c++ codes. You probably need to check more leetcode questions.

Sigiloso

23 de set. de 2016

Greedy approach works here. Its a simple O(N) solution. Just swap the adjacent numbers if they don't follow the given rule. Eventually this algorithm will generate correct output. I just don't want to write the complete explanation of why it works :P. Its a famous ques. called "Wiggle Sort". Google it.