Interview-Question-23: Company X

Question 1: 智力题:赛马

Description:

Solution

 

Question 2: N个无序排列的数中的前K大的数

Description

Solution

常规思路: MinHeap, i.e., std::priority_queue in C++ STL
  • O(nlogn) Time, O(n) Space

BinarySearch
  • O(n) Time, O(1) Space

Question 3: 逆序对的个数

Question 4: 正则匹配

 

Question 5: Reverse Linked List

  • Leetcode 206

发表评论

电子邮件地址不会被公开。 必填项已用*标注