|
It looks like the two programming problems require us to insert new elements into their correct positions in the array or arrays being used to represent the sparse array. This is easy to do with built-in functions in some languages, like splice() in Perl. Without them, it requires a bit more work because one has to write the code to shift all higher elements up one index. Right now, I have working versions that use splice(), but I was wondering if you wanted to see us write the insertion code ourselves.
|
Please show iterative insertion by Mike O'Donnell, 2001, Oct 28
to: