Home > Back-end >  Function arguments.
Function arguments.

Time:09-29

I define function int findKthMin (vector & Nums1 vector & Nums2, int k), including nums1 can be used as an array, and then I recursive calls to this function in the body of the function, then nums1 needs to move back, from nums1 start next recursive [2] this position, I want to take nums1 [2] address as the first parameter to the function, how should I write?

CodePudding user response:

Add a variable, such as int k, int x

CodePudding user response:

 
Int findKthMin (vector & Nums1 vector & Nums2, int k)
{
Vector Temp=nums1;
Temp. Pop_front ();
FindKthMin (temp, nums2, k);
}


No, don't know, but such spending is so big,,,
Can need not recursive places don't have,,, is inherently slow,,,

CodePudding user response:

Consider using an iterator do vector< parameters; int> : : iterator
  • Related