Some onsite algorithm questions

  1. Write a partition algorithm employed in qsort. Analyze time cost in bad, good, mean cases.

  2. Given a array, find there elements that a[i]+a[j]+a[k] == target. Explain why this algorithm works.

  3. Write a algorithm to print all the permuations of a array.

  4. Variable-width string encoding. while the first bit equals 0, this character is a one Byte character. When the first bit equals 1, this character is a two Byte character. Given a legal position, find its previous legal character.

  5. how to find median in mass data.

  6. some points are scattered, find a line to seperate them and keeps point counts in each plane equals.

  7. [3, 4, 5, 6, 7, 4, 3, 2], find median of such array.

  8. median of two sorted array.

  9. design a lottery system

你可能感兴趣的:(Some onsite algorithm questions)