0

good day everyone
i have a smart question and it is my homework i did not know how to start and what the ideas
Can you help ????


Write a linear-time algorithm that sorts n distinct integers, each of which is between 1 and
500. Hint: Use a 500-element array. (Linear-time means your algorithm runs in time c*n + b,
where c and b are any constants that do not depend on n. For example, your algorithm can run
in time n, or time 2n + 1, or time 5n + 10, or time 100n + 6, but not time c*n*n = c*n².)

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Infarction
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.