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

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 有一部電影,叫《風中奇緣》,講的是一位印第安公主的故事。 不過這幾天我才發現,這風中奇緣還有“2”...
    陌霄_Lu閱讀 820評論 1 3
  • 這次月考監場趕上的是倒數第二考場,差不多就是本年級學習最差的學生了。因為倒數第一場有些是上次缺考的,故而這屋里的4...
    朝飲木蘭之墜露兮Y閱讀 151評論 0 0
  • 想起以前的家 默默地尋找那一生的愛 父母已不在 家的影像 已刻在了我的腦海 苦苦的追求那一生的情 家人團聚 其樂融...
    筆耕心田閱讀 335評論 0 0
  • 吃貨不是因為餓,而是嘴太寂寞 菠蘿塊加糖醋里脊的感覺,喜歡這道充滿風情的菜~ 草莓,抹茶,奶油 除了他們家的牛蛙煲...
    liu寶寶閱讀 267評論 9 7