Sonoma State University | ||
Algorithm Analysis
|
||
Instructor: Henry M. Walker
Lecturer, Sonoma State University |
Although CS 415 has been well developed for several years, last year the CS faculty made a significant, long-term curricular change regarding SSU's Upper Division GE Area B Requirement.
Historically, CS Majors could satisfy this requirement by taking CS 454, Theory of Computation, and CS 454 will continue in this role for the next several semesters.
At some time in the future (but not Spring 2025), CS 415, Algorithm Analysis, will allow students to satisfy SSU's Upper Division GE Area B Requirement.
During an anticipated time of transition:
For future semesters, students should check with the CS faculty regarding which course(s) (CS 415 and/or CS 454) will satisfy SSU's Upper Division GE Area B Requirement.
Steps 1 and 2 require that you obtain a count of characters within a text, so that you can construct a Huffman code based on the text. Although you can count characters any way you wish, you may use program count-characters.c if you find that program to be helpful.
Construct a Huffman code and tree, based on the text
a computer science major can lead to wonderful career options!
Using your tree/code in Part a, encode the text given above.
Construct a Huffman code and tree to optimize the storage of the message
computing includes problem solving, algorithms, testing, analysis, and much more fun!!!
In this problem, consider upper and lower case letters to be equivalent (perhaps converting upper case letters to lower case in your counting and coding.)
Decode the front of the AP Computer Science t-shirt for 2002.
Consider the following undirected graph:
Find the shortest paths from vertex I to all other vertices, using Dijkstra's algorithm with the table discussed in class.
As discussed in class, solving this problem involves completing the following table, shown at initialization.
Vertex (v): | a | b | c | d | e | f | g | h | i | j |
---|---|---|---|---|---|---|---|---|---|---|
Cost to v, L(v): | ∞ | ∞ | ∞ | ∞ | ∞ | ∞ | ∞ | ∞ | 0 | ∞ |
Vertex before v on path from I, PV(v): | NA | NA | NA | NA | NA | NA | NA | NA | --- | NA |
S (vertices processed): |
Your answer must include the completed table after the algorithm has finished.
Find the minimum cost spanning tree, showing the main steps in applying the algorithm.
Consider the following undirected graph:
Find the shortest paths from vertex C to all other vertices.
As in the previous problem, you answer must include the completed table after the algorithm has finished.
Find the minimum cost spanning tree, showing the main steps in applying the algorithm.
Given an undirected graph, a minimum cost spanning trees need not be unique. Given an example of a graph with two different minimum cost spanning trees, where the graph has the fewest number of vertices and the fewest number of edges. In addition to displaying the graph and the two different minimum cost spanning trees, provide an explanation as to why this graph is the smallest possible with two different such trees.
created April 25, 2022 revised April 25, 2022 revised July 24, 2022 revised December 31, 2022 revised Summer 2023 revised November 17, 2024 |
|
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu. |
Copyright © 2011-2025
by Henry M. Walker.
|