j = 0
for i = 1 to n
    if a(i) not equal 0
        j = j + 1
        a(j) = a(i)
    end if
end for
for i = j + 1 to n
    a(i) = 0
end for

Dave

On Jun 26, 3:27 pm, jalaj jaiswal <[email protected]> wrote:
> Given an array of integers, {1,0,2,0,3,0,0,4,5,6,7,0,0,0}, you have to
> create a new array which will be like (1,2,3,4,5,6,7,0,0,0,0,0,0,0}, without
> using any other temporary array.
>
> --
> With Regards,
> Jalaj Jaiswal
> +919026283397
> B.TECH IT
> IIIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to