← 返回 citadel 的题目列表Merge K Sorted Arrays with OOD
类型:online_judge
Design a program to merge K sorted arrays with Object-Oriented Design (OOD) requirements. Implement a class to fulfill all functions in a given abstract class. Arrays are managed within a special class using shared_ptr. Implement auxiliary functions to support the merge operation and explain the time complexity of the core code.
Code Template
class ArrayContainer {
// Type aliases and data
}
class Solution {
// Implement abstract class and auxiliary functions
};
The code must handle inputs like:
Up to 100 arrays
Each array contains up to 1000 integers
Integer values range from -10^5 to 10^5
Example input:
[[1,4,5],[1,3,4],[2,6]]
Output:
[1,1,2,3,4,4,5,6]
Design a well-documented class structure and complete the code in C++.
Example
Input
[[1,4,5],[1,3,4],[2,6]]