• Re: Pascal Question

    From Vk3jed@21:1/109 to Al on Thu May 24 21:31:00 2018
    Al wrote to Vk3jed <=-

    Worksafe knows us well. They are here frequently making sure things are
    up to standards. We have had incidents here, a fire a few years ago on
    the melt deck that we all lost a few days work over but no one was
    hurt.

    I see. :)

    This one wasn't major though. The worker just needed to lose his
    coveralls and cool down then he was back to work although on light
    duty.

    That's not too bad. Probably more heat exhaustion than heat stroke.

    There is one cool place I forgot about. The lunch room is cool in
    summer and warm in winter. I rarely use it myself because I prefer to
    go outdoors and get some fresh air on my breaks.

    I'm with you, outdoors rules. :)


    ... You! What PLANET is this? McCoy, stardate 3134.0.
    === MultiMail/Win32 v0.49
    --- SBBSecho 3.03-Linux
    * Origin: Freeway BBS Bendigo,Australia freeway.apana.org.au (21:1/109)
  • From tenser@21:1/112 to xqtr on Sun May 27 11:12:50 2018
    Also you must do the comparisons approximately n^2 times, to fully sort the array of records you have.. where n is the size of the array/list of records you have. In this page you can see a complete example for string comparison in records. Check the Sort procedure. Its not the ideal algorithm for too many items.

    I'd be somewhat shocked and horrified if the default sorting algorithm
    provided by Free Pascal was O(n^2), let alone bubble sort (which is approximately the worst non-joke algorithm, even by O(n^2) criteria).

    More likely it is a heap or merge sort, to guarantee O(n lg n) time;
    the former if one wants O(1) space complexity as well. It may be quicksort, however, which has O(n lg n) average-case running time.

    Most sorting algorithms provided by most language libraries can be used
    on both strings and integers (they are "generic" on the input type), and
    if you want to sort by two keys, you provide a custom comparison function
    that sorts by the primary key and then the secondary key, *or* use a stable sort sorting by the secondary key and *then* the primary key.

    --- Mystic BBS v1.12 A39 2018/04/21 (Windows/32)
    * Origin: Black Flag : ACiD Telnet HQ> blackflag.acid.org:28 (21:1/112)
  • From xqtr@21:1/111 to tenser on Sun May 27 07:01:04 2018
    I'd be somewhat shocked and horrified if the default sorting algorithm provided by Free Pascal was O(n^2), let alone bubble sort (which is approximately the worst non-joke algorithm, even by O(n^2) criteria).

    I am not sure which algorithm FreePascal uses. I was referring to a piece of code in a link that i provided.

    .----- --- -- -
    | Another Droid BBS
    : Telnet : andr01d.zapto.org:9999 [UTC 11:00 - 20:00]
    . Contact : xqtr@gmx.com

    --- Mystic BBS v1.12 A38 2018/01/01 (Raspberry Pi/32)
    * Origin: Another Droid BBS (21:1/111)