I was solving a question on merging k sorted linked lists and I came across this vector<Node<int>*>:
Node<int>* mergeKLists(vector<Node<int>*> &listArray);
I want to know if it is a declaration of all the linked lists, if it is how it has been declared?
It's a vector of pointers to Nodes, where each Node pointed to is the first node of a linked list. The size of the vector would be
K, corresponding toKlinked lists. Each Node has one data member, an integer.The function merges the
Klinked lists and returns a single list. I don't know why the name listArray was chosen since the parameter is a vector.Based on the comment below, these are single linked lists.