注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
求大米求大米~~ 感谢大家求大米!!
Karat 总共60分钟,全程开摄像头。
1.自我介绍
2. 10分钟cs知识快问快答,5个领域选2个回答,
我选度。- You're developing a system for scheduling advising meetings with students in a Computer Science program. Each meeting should be scheduled when a student has completed 50% of their academic program.
- Each course at our university has at most one prerequisite that must be taken first. No two courses share a prerequisite. There is only one path through the program.
- Write a function that takes a list of (prerequisite, course) pairs, and returns the name of the course that the student will be taking when they are halfway through their program. (If a track has an even number of courses, and therefore has two "middle" courses, you should return the first one.)
- Sample input 1: (arbitrarily ordered)
- pairs1 = [
- ["Foundations of Computer Science", "Operating Systems"],
- ["Data Structures", "Algorithms"],
- ["Computer Networks", "Computer Architecture"],
- ["Algorithms", "Foundations of Computer Science"],
- ["Computer Architecture", "Data Structures"],
- ["Software Design", "Computer Networks"]
- ]
- In this case, the order of the courses in the program is:
- Software Design
- Computer Networks
- Computer Architecture
- Data Structures
- Algorithms
- Foundations of Computer Science
- Operating Systems
- Sample output 1:
- "Data Structures"
- Sample input 2:
- pairs2 = [
- ["Algorithms", "Foundations of Computer Science"],
- ["Data Structures", "Algorithms"],
- ["Foundations of Computer Science", "Logic"],
- ["Logic", "Compilers"],
- ["Compilers", "Distributed Systems"],
- ]
- Sample output 2:
- "Foundations of Computer Science"
- Sample input 3:
- pairs3 = [
- ["Data Structures", "Algorithms"],
- ]
- Sample output 3:
- "Data Structures"
- All Test Cases:
- halfway_course(pairs1) => "Data Structures"
- halfway_course(pairs2) => "Foundations of Computer Science"
- halfway_course(pairs3) => "Data Structures"
- Complexity analysis variables:
- <div>n: number of pairs in the input</div>
复制代码 求大米求大米~~ 感谢大家!求大米!!
|