#1
  1. Happy Monkey
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Location
    UK (University of Kentucky)
    Posts
    1,809
    Rep Power
    47

    What is an Algorithm?


    I know I am showing my ignorance when I say this, but what is an Algorithm? How is it used and can I use it in my PHP scripts?

    Thanks in Advance!
    Sam Powers
  2. #2
  3. yet another member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    262
    Rep Power
    14
    Hi!

    An algorithm is a non-ambiguous set of step-by-step actions to be taken in order to solve a problem. Often this is rendered in pseudo code (abstracted from any PHP or other).
    A PHP program would be one (of many possible) implementations of this algorithm.

    Am I missing something? Any informatics pros here?

    Regards,

    Atrus.
    Webmaster - Stefan Meier KG TABAKWAREN - Pfeifen, Premium-Zigarren, ... (_Ger)
  4. #3
  5. Wiking
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Sep 2000
    Location
    Sweden
    Posts
    3,608
    Rep Power
    27
    Found this somewhere:
    Algorithm is the process of abstracting the data, operations, and semantics of a problem, and then creating solutions out of those abstractions.

    Info about the guy who is said to have invented this stuff-> http://www-groups.dcs.st-and.ac.uk/~...Khwarizmi.html

    //NoXcuz
    UN*X is sexy!
    who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    Canada
    Posts
    1
    Rep Power
    0
    al·go·rithm n.

    A step-by-step problem-solving procedure, especially an established, recursive computational procedure for solving a problem in a finite number of steps.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Posts
    465
    Rep Power
    14
    Basically that's... programming! Except that it refers to actual code itself, as far as this forum is concerned, that's it.
  10. #6
  11. No Profile Picture
    Canta como rafaé
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Location
    Barcelona
    Posts
    74
    Rep Power
    14
    An algorithm is the process to solve a problem not necessarily depending on computers.

    "sum 1 to the variable i" is implemented as $i = $i + 1 in PHP or i++ in C.
    Thrasher



    'Y se ahogaron los dooos
    No eran duros pa pagar, cuñaaoo !!'
    El vagamundo - El risitas y su cuñao
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Location
    Belgrade, Yugoslavia
    Posts
    7
    Rep Power
    0

    Algorithms


    While most agree that algorithm can't be precisely defined in terms required for further manipulation, most "describe" it in a way as given above, or as a:

    "description of proccesses involved in solving a particular task"

    Though commonly used in computer science, it's roots are in mathematics, and that's what brings maths into computer science (actually vice versa, if we take a look at the history).

    The main points about algorithms are:
    1. what input is a particular algorithm expecting?
    2. what output will it give if input was "correct" (as expected)?
    3. what time will it take to complete ("efficiency" and directly related "complexity" of an algorithm)?

    This means that given same input data, a particular algorithm is expected to give same output in about the same time (counted in time units particular for a machine type and speed), no matter what language it is implemented in (C, C++, Java, PHP, Perl, Python, and lots of others most probably never heard of).

    There are several "formalizations" of algorithms, the most common one being the "Turing machine". With it, an algorithm is a description of a states and steps requried to compute something. This would require more formal understanding, so I won't discuss it anymore.

    That's it.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Sydney, NSW, Australia
    Posts
    40
    Rep Power
    15
    Algorithms and slightly different to pseudo-code. An Algorithm is much more descriptive, and doesn't contain mathematical symbols etc. Pseudo-code is the next step in the software development cycle. Someone goes through and translates the algorithms into descriptions closer to the actual programming language that it is to be translated into. Once this is done, the programmer converts the pseudo-code into the code that is to be used.

    Algorithms and Pseudo-code are very important steps in the software development cycle. Algorithms really encourage good software design, and encourage you to find the best solution to a problem. Start using algorithms with your PHP, your code will turn out a lot better.
    Cheers,
    Michael Bray
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    10
    Rep Power
    0
    essentially, how to do it, not the specific code required.

    Qin_23

IMN logo majestic logo threadwatch logo seochat tools logo