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