Counting_sort question

can you look into my code i am getting wrong answer.

image

the constraints are large
image

mke the index array larger

for small inputs also my code is giving wrong answer

image
what are u trying to do through these lines???

u can simple

after creating the index array
image
u can iterate through it and print that particular no the times it occurs in the array

something like
if index[1] = 1
print 1 once

index[2] = 2
print 2 twice
and where freq is 0
dont print

https://ide.codingblocks.com/s/281131 you are saying like this but then time complexity badh ni jaega as we are running a nested loop?

why ?
do u think the time complexity is increasing