what is the algorithm?
93226
algorithm is a basic and important part of programming. before writing any program(codes) we first design its algorithm i.e. genral steps to be taken to solve that program in normal english words called pseudocodes. so that one can easily understand what logic and aproach programmer has used to solve this problem.\n\nexample:\nalgorithm for multiplication of two numbers:\n1. declare three variables as a,b,c\n2. input first number into a\n3. input second number into b\n4. store c as a*b\n5. print c\n\nas this is not actual program but tells whats the logic behind this problem..\ni think you got answer
973
u spelt it wrong :-(\nit should have been Dijikstra\n\nSTDMETHODIMP CDijkstra::ShortestPath(long node1, long node2)\n{\n    ReleaseGraph();\n    // init d and pi\n    InitializeSource(g, g.m_nodes[node1-1]);\n    // Set S empty\n    VTYPE_NODE S;\n    // Put nodes in Q\n    VTYPE_NODE Q;\n    VTYPE_NODE::iterator kl;\n    for(kl=g.m_nodes.begin(); kl<g.m_nodes.end(); kl++)\n    {\n        CNode node = (*kl).Copy();\n        Q.push_back(node);\n    }\n    // Algorithm\n    while(Q.size())\n    {\n        CNode nod = ExtractMin(Q); // the minim value \n                // for the shortest path up to this step\n        S.push_back(nod);\n        // each vertex v which is a neighbour of u\n        VTYPE_NODE::iterator kl;\n        for(kl=g.m_nodes.begin(); kl<g.m_nodes.end(); kl++)\n        {\n            if(ExistEdge(nod, (*kl)))\n            {\n                bool gasit = false;\n                VTYPE_NODE::iterator kll;\n                for(kll=Q.begin(); kll<Q.end(); kll++)\n                {\n                    if((*kll).m_NodeNr == (*kl).m_NodeNr)\n                    gasit = true;\n                }\n                if(gasit)\n                    Relax(nod, (*kl), GetEdgeVal(nod, (*kl)));\n            }\n        }\n    }\n    RefreshDone(node1, node2);\n    return S_OK;\n}
29153
An algorithm is a way of solving a problem, kind of like an equation or a formula. It would provide a framework for plugging in variables and give you an answer. \nThe traveling salesman problem is scenario in which a salesman has to visit a number of cities all once. He wants to do this in such a way that he minimizes the total distance traveled. At a first glance, it seems like an easy problem - and it is when there are only a few cities. But it quickly gets so complicated that even the best computers can't come up with the shortest path. In relation to an algorithm, it would be very beneficial to find one equation that always shows us the shortest distance. If you can find it, there's a $1 million dollar prize... Hope this helps! Also, check out the website I've included as a source for more info.
647987
at first you have to understand every section of the algorithm properly. work out by that algorithm. solve more than one problems by using that algorithm in different manners, it helps you get into the algorithm. test your solutions. if you get wrong answer then debug your program.\ndebugging is the best way to learn programming.\n\nimplementing an algorithm is the best way to memorize an algorithm.\nfor different kind of problems visit:\nhttp://acm.uva.es/p/\nhttp://www.topcoder.com/
182266
Paraphrasing from wikipedia:\n\nAn algorithm is a procedure for accomplishing some task.\nA flowchart is a schematic representation of a process.\n\nThe distinction is that an algorithm is abstract (an idea)\nwhereas a flow chart is a concrete representation of\nthat idea.\n\nIt is like the difference between a "story" and a "book".
395965
The bubble sort is the simplest, easiest sort algorithm. It basically goes like this:\n\nfor(x = 0; x < ARRAY_SIZE; x++)\n{\n   for(y = 0; y < ARRAY_SIZE-1; y++)\n   {\n      if(iarray[y] > iarray[y+1])\n      {\n         swap = iarray[y+1];\n         iarray[y+1] = iarray[y];\n         iarray[y] = swap;\n      }\n   }\n}\n\nPieces of cake!
334220
The Viterbi algorithm is a dynamic programming algorithm for finding the most likely sequence of hidden states – known as the Viterbi path – that result in a sequence of observed events, especially in the context of hidden Markov models. The forward algorithm is a closely related algorithm for computing the probability of a sequence of observed events. These algorithms form a subset of information theory.\n\nHere's an example:\n\nAssume you have a friend who lives far away and whom you call daily to talk about what each of you did that day. Your friend has only three things he's interested in: walking in the park, shopping, and cleaning his apartment. The choice of what to do is determined exclusively by the weather on a given day. You have no definite information about the weather where your friend lives, but you know general trends. Based on what he tells you he did each day, you try to guess what the weather must have been like.\n\nYou believe that the weather operates as a discrete Markov chain. There are two states, "Rainy" and "Sunny", but you cannot observe them directly, that is, they are hidden from you. On each day, there is a certain chance that your friend will perform one of the following activities, depending on the weather: "walk", "shop", or "clean". Since your friend tells you about his activities, those are the observations. The entire system is that of a hidden Markov model (HMM).\n\nYou know the general weather trends in the area and you know what your friend likes to do on average. In other words, the parameters of the HMM are known. In fact, you can write them down in the Python programming language:\n\nstates = ('Rainy', 'Sunny')\n\nobservations = ('walk', 'shop', 'clean')\n\nstart_probability = {'Rainy': 0.6, 'Sunny': 0.4}\n\ntransition_probability = {\n   'Rainy' : {'Rainy': 0.7, 'Sunny': 0.3},\n   'Sunny' : {'Rainy': 0.4, 'Sunny': 0.6},\n   }\n\nemission_probability = {\n   'Rainy' : {'walk': 0.1, 'shop': 0.4, 'clean': 0.5},\n   'Sunny' : {'walk': 0.6, 'shop': 0.3, 'clean': 0.1},\n   }\n\nIn this fragment, start_probability refers to your uncertainty about which state the HMM is in when your friend first calls you (all you know is that it tends to be rainy on average). The particular probability distribution used here is not the equilibrium one, which is (given the transition probabilities) actually approximately {'Rainy': 0.571, 'Sunny': 0.429}. The transition_probability refers to the change of the weather in the underlying Markov chain. In this example, there is only a 30% chance that tomorrow will be sunny if today is rainy. The emission_probability tells you how likely your friend is to perform a certain activity on each day. If it's rainy, there is a 50% chance that he is cleaning his apartment; if it's sunny, there is a 60% chance that he will go outside for a walk.\n\nYou talk to your friend three days in a row and discover that on the first day he went for a walk, on the second day he went shopping, and on the third day he cleaned his apartment. You have two questions: What is the overall probability of this sequence of observations? And what is the most likely sequence of rainy/sunny days that would explain these observations? The first question is answered by the forward algorithm; the second question is answered by the Viterbi algorithm. These two algorithms are structurally so similar (in fact, they are both instances of the same abstract algorithm) that they can be implemented in a single function:\n\ndef forward_viterbi(y, X, sp, tp, ep):\n   T = {}\n   for state in X:\n       ##          prob.      V. path  V. prob.\n       T[state] = (sp[state], [state], sp[state])\n   for output in y:\n       U = {}\n       for next_state in X:\n
114851
It is a function, that express the relation between the amount of the input data and the amount of primitive operations that will be needed to complete a task.\n\nFor example if you have to find the sum of N numbers, one trivial solution would be to scan all of them and collect the sum incrementaly. Then you will be traversed one time each number, so the computational complecity will be f(N) - you see it is linear function.\n\nAnother example is the sorting N numbers. The famous quick sort algorithm have f(log(2,N)) - it is logarithmic.\n\nOfthen this function is showed as theta from the greek alphabet :)
47900
First, lets define encyption...\n===============================\n1.  To put into code or cipher.\n2. Computer Science. To alter (a file, for example) using a secret code so as to be unintelligible to unauthorized parties.\n3. In cryptography, encryption is the process of obscuring information to make it unreadable without special knowledge.\n\nTwo terms you have to be aware of when speaking of Encryption & Decryption - these terms are:\nCiphering, Deciphering and Algorithms:\n\n\nWhat is Cipher?\n===============\nA cipher is an algorithm for performing encryption (and the reverse, decryption) — a series of well-defined steps that can be followed as a procedure. An alternative term is encipherment.\n\n\nWhat is Algorithm?\n==================\nIn mathematics and computer science an algorithm is a finite set of well-defined instructions for accomplishing some task which, given an initial state, will terminate in a corresponding recognizable end-state. Algorithms can be implemented by computer programs.\n\nInformally, the concept of an algorithm is often illustrated by the example of a recipe, although many algorithms are much more complex; algorithms often have steps that repeat (iterate) or require decisions (such as logic or comparison).\n\nThe concept of an algorithm was formalized in 1936 by Alan Turing's Turing machines and Alonzo Church's lambda calculus, forming the foundation for the field of computer science.\n\nDifferent algorithms may complete the same task with a different set of instructions in more or less time, space, or effort than others. For example, given two different recipes for making potato salad, one may have peel the potato before boil the potato while the other presents the steps in the reverse order, yet they both call for these steps to be repeated for all potatoes and end when the potato salad is ready to be eaten.\n\n\nHow does Ciphers Work?\n=======================\nThe original information is known as plaintext, and the encrypted form as ciphertext. The ciphertext message contains all the information of the plaintext message, but is not in a format readable by a human or computer without the proper mechanism to decrypt it; it should resemble random gibberish to those not intended to read it.\n\n\nEncryption Methods:\n===================\nEncryption methods can be divided into symmetric key algorithms and asymmetric key algorithms. In a symmetric key algorithm (e.g., DES and AES), the sender and receiver must have a shared key set up in advance and kept secret from all other parties; the sender uses this key for encryption, and the receiver uses the same key for decryption. In an asymmetric key algorithm (e.g., RSA), there are two separate keys: a public key is published and enables any sender to perform encryption, while a private key is kept secret by the receiver and enables him to perform decryption.\n\nSymmetric key ciphers can be distinguished into two types, depending on whether they work on blocks of symbols of fixed size (block ciphers), or on a continuous stream of symbols.\n\n\nHow does Password Encryption Work?\n==================================\nWhen you enter a Password and is in the process of Validation, the password is encryted by the Application, WebSite, etc. by the Algorithm used (such as Blowfish, Twofish, DES, Skipjack, SHA, and Huffman)...\n\nThe data is then sent to the destination and decrypts the password for validation. Once there was a password match in the authentication process, access is granted...\n\nSimple encrytion could be something like:\n A = 01, B = 02, ... Z = 26\nif the password is HELLO, then the encrypted file would look like this:\nH = 08\nE = 05\nL = 14\nL = 14\nO = 17\nHELLO = 0805141417\n\nOf course they never do it like that as there is capital and small letters, numbers, signs, and special characters...\n\nSo, if they are to do it in a simple form, they they would use KeyAscii [Character Number (capital/small letter, number, etc)]\nSo, comp
86473
What exactly is the question?
150391
It is a strings proccessing alg which uses a failure function to improve the run time rather than bm alg\nrun time:m+n\nm:the length of the pattern\nn: the length of the text\nwe use tis algorithm to find the pat string in the text string..\nmore details \nmail me at ziko@math.com\ni can provid a pascal source for it
526760
go to the source - The Art of Computer Programming by Donald Knuth.  It is the bible of data structures.
16777
I'm not familiar with the algorithm, but I'll take a stab at the question. Reconstructing phylogenies genetically has to do with comparing DNA sequences. The mathmatical analysis has to do with determining what is the likelihood that two sequences of DNA can be the same by chance alone. If the odds are that they would be unlikely to be the same by random chance, they would be considered to have had a common ancestor.\n\nYou can think about the probabilities here. If you flip a coin twice, the chances of getting heads both times is pretty good. If you flip it a hundred times, the chance of getting heads everytime is diminishingly small. \n\nThe algorithm probably compares DNA sequences and determines how likely it is that they are related, and how closely related. I don't do this kind of work, so someone else may know specifically, but this would be the idea.
201370
The correct spell is algorithm.\n\nThe word in itself is a modification from the name of the first known algebrist: al-Khwarizhmiy (IX century).\n\nAlgorithm is a term used to indicate any finite and ordered sequence of actions needed and sufficient to solve a problem (even not a mathematical problem).\n\nAn exemple: any cooking recipe is an algorithm, if it gives precise measures and a precise sequence of actions to do.\n\nAnother exemple - the algorithm to decide if a number is even or not: \n- begin\n- take the number you want to test\n- take the half of the number and call it A\n- take the integer part of the half of the number and call it B\n- take the difference A-B\n- write "even" if A-B=0\n- write "odd" if A-B is not equal to 0\n- finish\n\nIf a sequence of instruction has not an end, it is called a procedure, rather than an algorithm.\n\nAn exemple of procedure:\n1- begin\n2- let A=1\n4- let A=A/2\n5- write "end" if A/2 is 0\n6- go to step 4 if A/2 is not 0\n\nTheorically, this is a never-ending procedure.\nIn fact, on any computer, for very small values of A/2, the machine will read 0 because of the limitations of the computer's number system, so it will be finished anyway.
725218
Modified Gram-Schmidt algorithm\n------------------- -----------------------\nA  is m x n,  with m ≥ n  s.t. rank(A) = n\n\n(a) For i = 1, ... , n \n`````````w_i = a_i\nEnd (a) For\n(b) For i = 1, ... , n\n`````````r_ii = ||w_i||\n`````````q_i = (w_i)/(r_ii)\n`````````(c) For j = i + 1, ... , n\n``````````````````r_ij = <q_i, w_j>\n``````````````````w_j = w_j - (r_ij)(q_i)\n`````````End (c) For\nEnd (b) For
322643
Its of or relating to the computer language, prolog, which is commonly used for AI programs.  Its a very flexible language.
747450
Sounds like Combinatorics.  Combinations, permutations, a bit of graph theory, discrete math, I usually describe it as "Advanced Counting".