Question: Q 2 2 . 3 . 1 ) [ 2 points ] Consider the following C + + implementation to answer the next subquestions: void
Q points Consider the following C implementation to answer the next subquestions:
void insertElement int newelement, int listlength, vector &vect int indx ;
bool flag;
bool flag false;
while indx listlength && flag
if new element vect indx
indx;
else
flag true;
for int ilistlength; iindx; i
vect i
vecti;
vect indx newelement;
Q What does this function do point
Q What is the running time of the best case scenario in terms of bigO point
Q What is the running time of the worst case scenario in terms of bigO point
Q How can we improve the running time of this function in the worst case scenario? bonus pointvoid insertElementint newelement, int listlength, vector
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
