Re: A clear difference between algorithm and a pattern

From: Donald Roby (droby_at_babsoncourt.com)
Date: 01/22/04


Date: Thu, 22 Jan 2004 01:37:47 GMT

On Wed, 21 Jan 2004 11:54:23 +0000, Jason wrote:

>
> "Ravi Shankar" <sujashankar@pacific.net.sg> wrote in message
> news:buj978$eeq$1@nobel2.pacific.net.sg...
> ...
>> Can anyone please give me a precise distinction between an algorithm and a
>> pattern?
>>
>> When I want to have a single instance, I use "Singleton". Similarly when I
>> want to sort some numbers I use "QuickSort" algorithm.
>>
>> Pattern is a quality without a name and is "reusable idea". Algorithm too
> is
>> a reusable idea.
> ...
> I don't know about precise.
>
> Algorithm is from latin I think, which roughly means (amongst other things)
> a stepwise method of doing something. An algorithm gives a method (often
> stepwise), it doesn't say how to solve a problem.
>
No. It's from an Arabic name. As such, there's no particular etymologic
meaning at all. But in common usage, it describes a rote procedure for
solving a specific problem.

> Patterns are, if you will, more like a tactic, or strategy (a plan...). They
> are ways of solving problems that crop up often. And a pattern can be used
> to solve many different problems - if the pattern 'fits'.

More like an idiom than an algorithm, but less language-specific than an
idiom.



Relevant Pages

  • Re: Serialize a Strategy Pattern List of objects with out xsi:type
    ... whether this is a strategy pattern or not. ... depends on how you define algorithm. ... As for your "secondly" comment about homework, ... suggest that you create a seperate class that you will serialize. ...
    (microsoft.public.dotnet.framework)
  • Re: Reading and writing a big file in Ada (GNAT) on Windows XP
    ... memory for a substring; this is very descriptively called memmemand ... common cases (no mapping, single character patterns, and so on). ... So in this case a better algorithm is probably the way to go (and I ... the source length is>M and the pattern length is>N, ...
    (comp.lang.ada)
  • Re: Mersenne Twister
    ... And no PRNG is unpredictable. ... >> Just give me the algorithm and the key and I can predict it ... >hard to write a test which is able to find a pattern. ... Since the key is far far shorter than the stream ...
    (sci.crypt)
  • Re: A clear difference between algorithm and a pattern
    ... A pattern is a "formalized" algorithm. ... arrangements of class abstractions. ... Dijkstra and Parnas software architecture is ...
    (comp.object)
  • Re: Search for byte pattern in a binary file.
    ... one of the algorithms posted does partially solve the buffer ... The Knuth-Morris-Pratt algorithm is a forward-only algorithm, ... If the search pattern is extremely large (on the order of several ... since disk access is extremely slow. ...
    (comp.lang.java.programmer)