Question: 2(a) Define the recursive function std ::vectornt> shiftK(const std ::vectorint>& data, const int& k); that moves all values less than or equal to k to

2(a) Define the recursive function std ::vectornt> shiftK(const std ::vectorint>& data, const int& k); that moves all values less than or equal to k to the left side of data, preserving their original ordering. You may not use any helper functions 2(b) Analyze the runtime of shiftK using a recursion tree and provide the additional space usage analysis for shiftK. Example: Given data-21518419312171511861,k -4 the call shiftK (data,k) would return the following: 21413121115181917151816 Note: iterative solutions will not receive any credit for the code or analysis. 2(a) Define the recursive function std ::vectornt> shiftK(const std ::vectorint>& data, const int& k); that moves all values less than or equal to k to the left side of data, preserving their original ordering. You may not use any helper functions 2(b) Analyze the runtime of shiftK using a recursion tree and provide the additional space usage analysis for shiftK. Example: Given data-21518419312171511861,k -4 the call shiftK (data,k) would return the following: 21413121115181917151816 Note: iterative solutions will not receive any credit for the code or analysis
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
