0 votes 0 votes Q- consider an array A of size K where each element is either 10 or 20 what is the minimum time required to sort an array A?????? Algorithms sorting time-complexity + – Lokesh Arya asked Jul 1, 2018 • retagged Jun 19, 2022 by makhdoom ghaya Lokesh Arya 294 views answer comment Share Follow See 1 comment See all 1 1 comment reply Ayush Upadhyaya commented Jul 1, 2018 reply Follow Share use counting sort to sort in O(N) time 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes take B{k] and constant=10 for i=0 to size if(A[i]==c) B[i]=A[i]; ---- fill 10 from left side else B[k-i]=A[i]; ---- fill 20 from right side taking O(N) only Shaik Masthan answered Jul 1, 2018 Shaik Masthan comment Share Follow See all 0 reply Please log in or register to add a comment.