Feedback Yes, you must move items to insert 

Forum: U Chicago, Com Sci 221, autumn 2000
Re: News Assignment #5, due Monday 30 October (Mike O'Donnell)
Re: Question How good do you want the insert command? (Gary Yeung)
Date: 2000, Oct 29
From: Mike O'Donnell <odonnell@cs.uchicago.edu>

If an item is suppose to be inserted into a given location and something is already there do you want us to shift the entries around if there is free space ... ?
Yes. That's the usual meaning of ``insert,'' and really the only thing that's vaguely useful here. Otherwise, you'd only be able to insert names that are bigger than all the ones already in the directory. Insertion fails only if you're out of space.

The moving of items during insertion is where you'll notice the structural difference between the parallel arrays and the array of records. The difference won't look dramatic in this little exercise, but you should imagine how much worse it could be if there were lots of other operations that moved directory entries around.



Mike O'D.


Messages

1. Question ok, can we sort? by Gary Yeung, 2000, Oct 29
(_ Feedback Why sort when you don't have to? by Mike O'Donnell, 2000, Oct 29

to: "Yes, you must move items to insert"