Article View: csu.cs.200
Article #125Re: Extend_STK()
From: John Erickson
Date: Thu, 22 Oct 1998 00:00
Date: Thu, 22 Oct 1998 00:00
19 lines
1586 bytes
1586 bytes
Wouldn't it make more sense to just create the new extended stack, copy the current one to that and update your pointers? This means there is only one copy operation and a fair amount less code. Chris Carlson wrote: > > Try writing the Extend_STK function without the copy constructor and > assignment operator. Basically, what I did was copy the stack to a > temporary stack, extend the origonal stack by the extend size, and then > copy the temporary stack to the extended stack. Also, make sure you > update the maximum stack size. Hope this helps. -- -==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==- John Erickson jerickso@holly.colostate.edu Black Sands Consulting Computer Science Major If they can make penicillin out of moldy bread, they can sure make something out of you. -- Muhammad Ali -==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
Technical Details
Message-ID:
<362F9D34.8E57ECED@holly.colostate.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<362EC559.7273D88A@holly.colostate.edu> <362F8A62.A3334FFB@holly.colostate.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 127144,6c45165c401d3feb X-Google-Attributes: gid127144,public From: John Erickson <jerickso@holly.colostate.edu> Subject: Re: Extend_STK() Date: 1998/10/22 Message-ID: <362F9D34.8E57ECED@holly.colostate.edu> X-Deja-AN: 404059868 Content-Transfer-Encoding: 7bit References: <362EC559.7273D88A@holly.colostate.edu> <362F8A62.A3334FFB@holly.colostate.edu> Content-Type: text/plain; charset=us-ascii Organization: Black Sands Consulting Mime-Version: 1.0 Reply-To: jerickso@holly.colostate.edu Newsgroups: csu.cs.200