home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,249 of 2,978   
   mm to All   
   Re: sorting stack data with pop and push   
   24 Aug 06 14:00:53   
   
   From: mm@nospam.net   
      
   Femme Verbeek a écrit :   
   > yaniv.dg@gmail.com schreef:   
   >> hi all,   
   >> i'm trying to sort data in a stack,   
   >> i have an option to use 2 more stacks,   
   >> what is the way to sort the data with it?   
   >>   
   > There is no such thing as a stack kind of variabele in TP/BP.   
   >   
   > The stack segment is a maximum of 64 kB of memory used for storing local   
   > and global variabeles. Above that is the heap, that is used for storing   
   > dynamic variabeles.   
   > so:   
   >  var mybuf:^array [1..1000] of integer;   
   >   
   > stores just 4 bytes on the stack for the pointer.   
   >   
   > begin   
   >   getmem(mybuf,1234);   
   >   
   > allocates 1234 bytes on the heap which can store 617 integers.   
   >   
   >   
   > A nice way to sort data in TP/BP is to make use of the   
   > Tsortedcollection. Read the build in help topic on the subject.   
      
   But there this is presumably a homework (the OP asked "what is the?"   
   and not "is there a?") and its goal is presumably to find and use   
   an algorithm like the Hanoi tower one.   
      
   mm   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca