George claims he has a fast way to do path compression in a partition structure, starting at a position p. He puts p into a list L, and starts following parent pointers. Each time he encounters a new position, q, he adds q to L and updates the parent pointer of each node in L …

Continue reading "George claims he has a fast way to do path compression in a partition structure, starting at a…"
Say that a maze is constructed correctly if there is one path from the start to the finish, the entire maze is reachable from the start, and there are no loops around any portions of the maze. Given a maze drawn in an n × n grid, how can we determine if it is constructed …

Continue reading "Say that a maze is constructed correctly if there is one path from the start to the finish, the…"
A company named RT&T has a network of n switching stations connected by m high-speed communication links. Each customer’s phone is directly connected to one station in his or her area. The engineers of RT&T have developed a prototype video-phone system that allows two customers to see each other during a phone call. In order …

Continue reading "A company named RT&T has a network of n switching stations connected by m high-speed…"
The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee. Suppose the telephone network of a company named RT&T is a tree. The engineers of RT&T want to compute the maximum possible time delay …

Continue reading "The time delay of a long-distance call can be determined by multiplying a small fixed constant by…"
Tamarindo University and many other schools worldwide are doing a joint project on multimedia. A computer network is built to connect these schools using communication links that form a tree. The schools decide to install a file server at one of the schools to share data among all the schools. Since the transmission time on …

Continue reading "Tamarindo University and many other schools worldwide are doing a joint project on multimedia. A…"
An independent set of an undirected graph G = (V,E) is a subset I of V such that no two vertices in I are adjacent. That is, if u and v are in I, then (u,v) is not in E. A maximal independent set M is an independent set such that, if we were to …

Continue reading "An independent set of an undirected graph G = (V,E) is a subset I of V such that no two vertices…"
Consider the following greedy strategy for finding a shortest path from vertex start to vertex goal in a given connected graph. 1: Initialize path to start. 2: Initialize set visited to {start}. 3: If start=goal, return path and exit. Otherwise, continue. 4: Find the edge (start,v) of minimum weight such that v is adjacent to …

Continue reading "Consider the following greedy strategy for finding a shortest path from vertex start to vertex…"
NASA wants to link n stations spread over the country using communication channels. Each pair of stations has a different bandwidth available, which is known a priori. NASA wants to select n−1 channels (the minimum possible) in such a way that all the stations are linked by the channels and the total bandwidth (defined as …

Continue reading "NASA wants to link n stations spread over the country using communication channels. Each pair of…"
Inside the Castle of Asymptopia there is a maze, and along each corridor of the maze there is a bag of gold coins. The amount of gold in each bag varies. A noble knight, named Sir Paul, will be given the opportunity to walk through the maze, picking up bags of gold. He may enter …

Continue reading "Inside the Castle of Asymptopia there is a maze, and along each corridor of the maze there is a…"
Karen has a new way to do path compression in a tree-based union/find partition data structure starting at a position p. She puts all the positions that are on the path from p to the root in a set S. Then she scans through S and sets the parent pointer of each position in S …

Continue reading "Karen has a new way to do path compression in a tree-based union/find partition data structure…"