Target EasyMac Clearence# PennySaver - 省钱一族
G*A
1 楼
貌似一道老题,记得有人讨论过。
Given a sorted linked list. Each node is an interval consisting of two
integers. Implement a function to insert a given interval into the list and
maintain the order. Be careful about all possible cases.
e.g., List: (1,5), (9, 12), (21, 24). Given interval (10, 23)
--> newList: (1,5), (9, 24)
Given a sorted linked list. Each node is an interval consisting of two
integers. Implement a function to insert a given interval into the list and
maintain the order. Be careful about all possible cases.
e.g., List: (1,5), (9, 12), (21, 24). Given interval (10, 23)
--> newList: (1,5), (9, 24)