udi+manber+算法引论习题解答 - CSE 413 Analysis of...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 413, Analysis of Algorithms Fall Semester, 2004 Assignment 1: The Hamiltonian Cycle Problems Due Date : Sept. 8, 2004 (at the beginning of CSE 413 class) 1. Exercise 1.9, page 6 of the textbook. (This is in fact an instance of the Hamiltonian cycle problem ; also see pages 243-244 for the definition of this problem.) (20 points) 2. Design an algorithm to solve the Hamiltonian cycle problem for an arbitrary undirected graph (not necessarily dense), and analyze the time complexity of your algorithm. The input is an undirected graph represented by an adjacency matrix (see page 84 for the adjacency matrix representation of a graph). The output is either a sequence of vertices corresponding to a Hamiltonian cycle in the graph (if one exists), or a “No” if the input graph does not admit any Hamiltonian cycle. (20 points) 3. Write and test a computer program for Problem 2 in either C or C++ ( Java would be fine too). For this exercise, submit your program source code and your output on some test examples. Also, run your program on graphs of 5, 6, 7, 8, 9, and 10 vertices.
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern