How create algorithms

Discussion in 'C++' started by FloWo3, Sep 2, 2004.

  1. FloWo3

    FloWo3 Guest

    Hi,

    how do you create (design) algorithms.
    I'm talking about thinking about it and come to an idea.

    Tanks, FroxX
     
    FloWo3, Sep 2, 2004
    #1
    1. Advertising

  2. FloWo3 wrote:
    >
    > Hi,
    >
    > how do you create (design) algorithms.
    > I'm talking about thinking about it and come to an idea.
    >


    Paper, lots of paper.
    Pencil, lots of pencil
    Trying to solve the problem on Paper
    and pencil. Once I can solve the problem
    on paper -> repeat the whole thing and
    monitor what I do.

    Once you think you have an algorithm, go through
    it with someone else. It really doesn't matter if
    that someone understands what you are talking about.
    Just having the need to express your ideas in talken
    language is enough. You can even talk to a teddy bear
    and it works.

    --
    Karl Heinz Buchegger
     
    Karl Heinz Buchegger, Sep 2, 2004
    #2
    1. Advertising

  3. FloWo3 wrote:

    > Hi,
    >
    > how do you create (design) algorithms.
    > I'm talking about thinking about it and come to an idea.
    >
    > Tanks, FroxX


    The morning in the bed, a quarter of hour before the ring bells.
    I take the problem (usually the algoritm) of the day before, and usually
    I get it...


    Pierre Couderc
     
    Pierre Couderc, Sep 2, 2004
    #3
  4. FloWo3

    osmium Guest

    FloWo3 writes:

    > how do you create (design) algorithms.
    > I'm talking about thinking about it and come to an idea.


    My most effective tool is my sub-conscious. I try to understand what the
    problem is and then go on with my life. If I'm lucky, which I quite often
    am, a solution will come to me in the next few hours.
     
    osmium, Sep 2, 2004
    #4
  5. FloWo3 wrote:

    > Hi,
    >
    > how do you create (design) algorithms.
    > I'm talking about thinking about it and come to an idea.


    I figure out how to do it by hand, keeping track of *everything* I do
    and *everything* I have to remember. If you don't know how to do it
    yourself, you don't have an algorithm.

    --
    Will Twentyman
    email: wtwentyman at copper dot net
     
    Will Twentyman, Sep 2, 2004
    #5
  6. FloWo3

    Howard Guest

    "Karl Heinz Buchegger" <> wrote in message
    news:...
    > FloWo3 wrote:
    > >
    > > Hi,
    > >
    > > how do you create (design) algorithms.
    > > I'm talking about thinking about it and come to an idea.
    > >

    >
    > Paper, lots of paper.
    > Pencil, lots of pencil
    > Trying to solve the problem on Paper
    > and pencil. Once I can solve the problem
    > on paper -> repeat the whole thing and
    > monitor what I do.
    >
    > Once you think you have an algorithm, go through
    > it with someone else. It really doesn't matter if
    > that someone understands what you are talking about.
    > Just having the need to express your ideas in talken
    > language is enough. You can even talk to a teddy bear
    > and it works.
    >


    Yeah, but my teddy bear keeps correcting me..it's really annoying! :)

    -Howard
     
    Howard, Sep 2, 2004
    #6
  7. FloWo3

    Mike Wahler Guest

    "Karl Heinz Buchegger" <> wrote in message
    news:...
    > FloWo3 wrote:
    > >
    > > Hi,
    > >
    > > how do you create (design) algorithms.
    > > I'm talking about thinking about it and come to an idea.
    > >

    >
    > Paper, lots of paper.
    > Pencil, lots of pencil
    > Trying to solve the problem on Paper
    > and pencil. Once I can solve the problem
    > on paper -> repeat the whole thing and
    > monitor what I do.
    >
    > Once you think you have an algorithm, go through
    > it with someone else. It really doesn't matter if
    > that someone understands what you are talking about.
    > Just having the need to express your ideas in talken
    > language is enough. You can even talk to a teddy bear
    > and it works.


    :) This isn't as strange as it might sound to some. Since
    I mostly work alone at home, I usually can't discuss problems
    'face to face' with someone. When I get stuck, sometimes I'll
    'consult' with my cat. Of course his only answers are "Meow"
    and perhaps rubbing against my leg. But As Karl says, just
    vocalizing an issue can help uncover a solution. And Kitty
    seems to appreciate the attention. :)

    -Mike
     
    Mike Wahler, Sep 2, 2004
    #7
  8. Mike Wahler wrote:
    [snip]
    > :) This isn't as strange as it might sound to some. Since
    > I mostly work alone at home, I usually can't discuss problems
    > 'face to face' with someone. When I get stuck, sometimes I'll
    > 'consult' with my cat. Of course his only answers are "Meow"
    > and perhaps rubbing against my leg. But As Karl says, just
    > vocalizing an issue can help uncover a solution. And Kitty
    > seems to appreciate the attention. :)
    >
    > -Mike
    >
    >


    My cats seem to have a one track mind:

    Me: "What do you think about using multiple traversal pointers
    and choosing the one or more that succeed?"
    Cat:"Time to eat already! Meow!"

    Me: "Is it better to use a global hash table or one for each scope?"
    Cat:"Time to eat already! Meow!"

    ....

    -Rich

    --
    Richard Pennington
    Email:
    http://www.pennware.com ftp://ftp.pennware.com
     
    Richard Pennington, Sep 3, 2004
    #8
  9. FloWo3 wrote:
    > Hi,
    >
    > how do you create (design) algorithms.
    > I'm talking about thinking about it and come to an idea.
    >
    > Tanks, FroxX


    Recipe for Algorithm

    20 parts reading
    1 part inspiration
    99 parts perspiration

    adjust to taste
     
    Shailesh Humbad, Sep 3, 2004
    #9
  10. FloWo3

    David Hilsee Guest

    "Richard Pennington" <> wrote in message
    news:mjQZc.7189$...
    > Mike Wahler wrote:
    > [snip]
    > > :) This isn't as strange as it might sound to some. Since
    > > I mostly work alone at home, I usually can't discuss problems
    > > 'face to face' with someone. When I get stuck, sometimes I'll
    > > 'consult' with my cat. Of course his only answers are "Meow"
    > > and perhaps rubbing against my leg. But As Karl says, just
    > > vocalizing an issue can help uncover a solution. And Kitty
    > > seems to appreciate the attention. :)
    > >
    > > -Mike
    > >
    > >

    >
    > My cats seem to have a one track mind:
    >
    > Me: "What do you think about using multiple traversal pointers
    > and choosing the one or more that succeed?"
    > Cat:"Time to eat already! Meow!"
    >
    > Me: "Is it better to use a global hash table or one for each scope?"
    > Cat:"Time to eat already! Meow!"


    With my cat, the response is always "Why aren't you petting me? Meow!" I
    think he's very intelligent, because he always has an answer for all of my
    questions. I don't always understand his answers, but that's just a
    communication issue. It still helps me (just as it helps Mike Wahler),
    because I can have a phony conversation with my cat for a fair amount of
    time before he becomes bored and walks away. :) I figure that some people
    might think I was fit for a straightjacket if they saw me doing that. If
    he's not around, I wind up talking to myself, which works almost as well,
    but isn't much better when witnessed by others. :)

    --
    David Hilsee
     
    David Hilsee, Sep 4, 2004
    #10
  11. FloWo3

    Mabden Guest

    "FloWo3" <> wrote in message
    news:...
    >
    > how do you create (design) algorithms.
    > I'm talking about thinking about it and come to an idea.
    >


    Examine the problem in small steps. Break down each little piece into
    baby steps.

    Contrary to other posts, I don't use paper and pen unless I'm trying to
    visualize the actions of a loop of something like that.

    I start in with an editor (not necessarily an IDE, Notepad works fine)
    and start by just typing in comments of the steps I think I need, like
    this:
    ---------------------------------------
    // allocate variables

    // open input file

    // read data from file (into struct, line at a time, or whatever)
    ---------------------------------------

    As I'm working I fill in things I find I need, like this:
    ---------------------------------------
    // allocate variables
    // loop counter, if necc.
    // line buffer
    // struct for file data, or alloc as needed

    // open input file

    // loop to read data from file into struct one line at a time
    // read a line into line buffer
    // parse line buffer into struct

    // close file

    // do something with data struct

    // deallocate as necc.
    ---------------------------------------

    The above is more C-like than C++, but you get the idea.

    I try get the full problem scoped out before writing any real code, and
    if some step is very complicated I just open another notepad for that
    function or class. Eventually, I find things that I can fill in as real
    code, but I try to resist that as long as possible.

    Some will say that you have to use paper for this process, but editors
    work for me. YMMV. On the plus side of this method you end up with fully
    commented code at the end. And the comments are sometimes more correct,
    since they change as the design is fleshed out - before the code is
    written.

    --
    Mabden
     
    Mabden, Sep 7, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas
    Replies:
    0
    Views:
    512
    Andreas
    Dec 2, 2003
  2. abhinav

    encryption algorithms

    abhinav, Dec 26, 2004, in forum: VHDL
    Replies:
    2
    Views:
    651
  3. Melanie Nasic
    Replies:
    19
    Views:
    3,051
    Thomas Rudloff
    Jan 1, 2006
  4. Soenke
    Replies:
    0
    Views:
    568
    Soenke
    Dec 28, 2005
  5. Oracle3001

    De-Interlacing Algorithms

    Oracle3001, Jul 21, 2003, in forum: Java
    Replies:
    0
    Views:
    506
    Oracle3001
    Jul 21, 2003
Loading...

Share This Page