s0023
This commit is contained in:
21
include/s0023_merge_k_sorted_lists.hpp
Normal file
21
include/s0023_merge_k_sorted_lists.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef S0023_MERGE_K_SORTED_LISTS
|
||||
#define S0023_MERGE_K_SORTED_LISTS
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct ListNode {
|
||||
int val;
|
||||
ListNode* next;
|
||||
ListNode() : val(0), next(nullptr) {}
|
||||
ListNode(int x) : val(x), next(nullptr) {}
|
||||
ListNode(int x, ListNode* next) : val(x), next(next) {}
|
||||
};
|
||||
|
||||
class Solution {
|
||||
public:
|
||||
ListNode* mergeKLists(vector<ListNode*>& lists);
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user