Re: Keep a file in memory an any cost

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/11/2011 01:54 PM, Tim wrote:
> Back when I worked in a library, one of our fears was that some
> miscreant would tip out the card file index, and we'd have to spend an
> unimaginable amount of time putting the cards back in order.

Yes, I know.  Back in the mid '80s I did a little work for a concrete 
company who had an early mini-computer.  One day the data entry girl 
came over and asked if I could speed up the program that sorted the list 
of customers.  It had roughly 300 names and took an hour to sort -- far 
longer than it took her to do it by hand.  Whoever wrote it was using a 
disk file as an array (It was built into the BASIC for that computer.) 
and doing a bubble sort, moving each element every time it shifted.  I 
re-wrote it as a Shell Sort, changing only the pointers.  After the sort 
was over, I copied the old file into a new one in the order of the array 
of pointers, deleted the old file and renamed the new one.  It took 
about three minutes.  Then, in a blinding display of ingratitude, she 
complained because the new sort wasn't stable: if entry N and N+3 were 
equal, they might end up in reverse order unlike the bubble sort which 
would keep that relationship unaltered.  Of course, she hadn't specified 
that she wanted (not, mind you, needed) that before hand.
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux