Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2004

Tip: Looking for answers? Try searching our database.

code to do a brute force algorithm?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tony - 30 May 2004 04:30 GMT
Are there any vb source code that implements a brute force algorithm?
Any help is appreciated.
Thanks.
Howard Kaikow - 30 May 2004 14:34 GMT
Each algorithm requires different code unique to the algorithm and to the
particular method of implementing the algorithm.
Signature

http://www.standards.com/; See Howard Kaikow's web site.

> Are there any vb source code that implements a brute force algorithm?
> Any help is appreciated.
> Thanks.
Jay Freedman - 30 May 2004 18:48 GMT
Tony,

Howard has shown admirable restraint, but I suspect he hasn't made
himself completely clear. Your question simply raises another
question: "a brute force algorithm to do *what*?" There are zillions
of algorithms for searching, sorting, merging, formatting, all sorts
of tasks.

The term "algorithm" means simply "a sequence of steps". The term
"brute force" means "the slow, stupid way" as opposed to "the fast,
(maybe) smart way". Neither of these terms uniquely specifies what you
want to do.

If you're just looking for an example, try comparing the many ways of
sorting a list of items. The "bubble sort" is a classic brute force
algorithm for sorting, compared to algorithms such as "quicksort" and
"shell sort". The graph at
http://linux.wku.edu/~lamonml/algor/sort/sort.html illustrates how
much more work the brute force requires. VB code for these sorting
algorithms can be found in many places, such as
http://www.google.com/url?sa=U&start=1&q=http://www.vb-helper.com/tut1.htm&e=7370
and http://www.devx.com/vb2themax/Article/19900.

If you're looking for code for other kinds of algorithms, Google is
your friend. I found the articles I cited by searching for
   "sorting algorithms" +vb
and looking at the first half-dozen of over 1900 hits.

>Each algorithm requires different code unique to the algorithm and to the
>particular method of implementing the algorithm.
>> Are there any vb source code that implements a brute force algorithm?
>> Any help is appreciated.
>> Thanks.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://www.mvps.org/word
Howard Kaikow - 31 May 2004 22:09 GMT
My restraint is due to my being on painkillers.

In addition to looking at examples of sorting code, the poster could look at
the Sort Performance Comparison Program at
http://www.standards.com/Sorting/SortPerformanceComparison-Description.html.

IMHO, there's nothing wrong with use a "brute force" algorithm the first
time around. It takes time to earn how to improve algorithms or to find
better prepublished algorithms. In many cases, algorithms published in
VB/VBA books are not so desirable.

In addition the particular coding techniques can make an enormous
difference. For example, looking to the future, using the Stringbuilder
class in VB .NET is more than 800 times faster than do the typical string
concatenation of, say, x = x +"A". One example I ran was 852 times faster.

Oh well, I'm  overdue for another painkiller!
Signature

http://www.standards.com/; See Howard Kaikow's web site.

> Tony,
>
[quoted text clipped - 16 lines]
> much more work the brute force requires. VB code for these sorting
> algorithms can be found in many places, such as

http://www.google.com/url?sa=U&start=1&q=http://www.vb-helper.com/tut1.htm&e=7370
> and http://www.devx.com/vb2themax/Article/19900.
>
[quoted text clipped - 13 lines]
> Jay Freedman
> Microsoft Word MVP        FAQ: http://www.mvps.org/word
Jonathan West - 01 Jun 2004 01:41 GMT
> My restraint is due to my being on painkillers.
>
> In addition to looking at examples of sorting code, the poster could look at
> the Sort Performance Comparison Program at

http://www.standards.com/Sorting/SortPerformanceComparison-Description.html.

> IMHO, there's nothing wrong with use a "brute force" algorithm the first
> time around. It takes time to earn how to improve algorithms or to find
[quoted text clipped - 5 lines]
> class in VB .NET is more than 800 times faster than do the typical string
> concatenation of, say, x = x +"A". One example I ran was 852 times faster.

Karl Peterson has done an equivalent of the VB.NET stringbuilder class in
VB6. It can be imported into VBA with no modification (I have used it in my
own projects). It has a performance comparable to the VB.NET stringbuilder.
Go to http://www.mvps.org/vb/samples.htm and scroll down until you get to
the StrBldr.zip sample.

Signature

Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.