|
CSE Home | About Us | Search | Contact Info |
E.g., if I want the vertex that has the lowest number, may I write?:
Vertex := Min (VertexA, VertexB);Or should I be more detailed?:
temp := vertexA; if(vertexB < vertexA) temp:=vertexA;
A: I don't want code, I want a clear, understandable description of the method. A program is a communication between you and a machine; an algorithm is a communication between you and another human about a program.
E.g., "Min (VertexA, VertexB)" is fine, but I'd be just as happy with English: "between vertices A and B, choose the one with the smaller vertex number", or "keep an array with an entry for each vertex holding the count of the number of times that vertex is reached during process X and find the vertex with the min count." If you need a balanced binary search tree, say "using an AVL tree from chapter 4 or my data structures class, we can ..."; definitely don't give me AVL code.
The basic issue is that you should break the problem down into steps that are clear enough that everyone else in the class should be able to:
Computer Science & Engineering University of Washington Box 352350 Seattle, WA 98195-2350 (206) 543-1695 voice, (206) 543-2969 FAX [comments to cse421-webmaster@cs.washington.edu] |