Question: split a list into two equal size

this is a practice question that my professor give us. we need to write down the procedure

Given a list L of size N, split it into two equal size
lists L1 and L2 such that
– L1 = L[1..N/2]
– L2 = L[N/2+1..N]
• Use Select Sort to sort list L1
• Use Select Sort to sort list L2
• Merge the sorted L1 and L2 into a list L3 suchthat L3 is sorted.
• Print list L3

thanks

we are not allowed to use any build-in procedure such as Max

 

Please Wait...