www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/07/02:31:50

From: "Damian Yerrick" <web DOT poison AT pineight DOT 8m DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How do I allocate more memory for .exe?
Date: Wed, 6 Oct 1999 20:20:45 -0500
Organization: Rose-Hulman Institute of Technology
Lines: 23
Message-ID: <7tgsl6$djh$1@solomon.cs.rose-hulman.edu>
References: <37FBA7A1 DOT B7FAEBD6 AT cc DOT umanitoba DOT ca>
NNTP-Posting-Host: yerricde.laptop.rose-hulman.edu
X-Trace: solomon.cs.rose-hulman.edu 939259366 13937 137.112.205.146 (7 Oct 1999 01:22:46 GMT)
X-Complaints-To: news AT cs DOT rose-hulman DOT edu
NNTP-Posting-Date: 7 Oct 1999 01:22:46 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

umaveci0 <umaveci0 AT cc DOT umanitoba DOT ca> wrote in message
news:37FBA7A1 DOT B7FAEBD6 AT cc DOT umanitoba DOT ca...
> I have an assignment in which I must write a program which solves a
> letter 'Jumble'. User types in some letters (rivfey, for example), all
> permutations (different combinations) of the letters are put into a
> vector ( vector<string> ) and each permutation is compared to another
> vector of strings containing about 20,000 words (a dictionary) to get
> the answer (verify). Problem is I run out of memory.  Both
> vector<string> 's are big and solving a 6 letter Jumble causes the
> program to crash (5 is okay). I am referencing the vectors. How do I
> allow the program to use more memory?

In general, if you're running out of memory, try a different
algorithm. In this case, try generating each permutation and
then binary searching for it in the dictionary.


Damian Yerrick
http://come.to/yerrick



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019