Stipek: Stop and Think Flashcards
For a graph with all unique edge weights, both Kruskal’s and Prim’s Algorithm will always return the same exact MST. Why might this be the case?
If a graph have unique edge weights that means every path between any two nodes must be unique.????
Can a graph have more than one spanning tree that fulfills the four spanning tree properties mentioned above?
Yes.
If edge weighs are not all entirely unique multiple paths using edges of the same weights can generate the same minimum value with different edge sets
Which of the following are valid ways to modify an unweighted graph to have Dijkstra’s Algorithm be able to accurately produce the shortest paths from one vertex to all other vertices?
We can assign a cost of 1 to each edge.
We can assign a cost of ¹/₂ to each edge.
STOP and Think: It is important to note that there does not exist such a simple recursive pseudocode for Breadth First Search; why might this be the case?
????
Is it because of the vague base case?
STOP and Think: If our database string D has length n, what is the space complexity of storing all of its n suffixes?
You need to store n, then n-1, then n-2, then …… until 1
So its (n) + (n-1) + (n-2) + … (2) + (1) = n(n+1)/2 ~ n^2
STOP and Think: How can we reformulate our algorithm to find the correct first and last suffixes?
Instead of doing a single binary search to determine whether or not we have any matches, do two binary searches with slightly different “success” criteria:
Find the i-th suffix that begins with w such that the (i-1)-th suffix does not start with w. This is the start of the range of matches Find the j-th suffix that begins with w such that the (j+1)-th suffix does not start with w. This is the end of the range of matches
STOP and Think: (end of Suffix array) Can we think of an even more clever preprocessing of our database sequence to enable even faster query searches?
Burrows Wheeler Transform
STOP and Think: Is there any way for us to reconstruct our original string using only the first and last columns of our Burrows-Wheeler Matrix?
For each letter __ m, the i-th occurence of x in the first column happens to correspond to the exact same lette in the original string as the i-th occurence in the last column.
STOP and Think: Given only the BWT, do we actually need the original string (or any information about the original string) to construct any parts of this table?
Not really
STOP and Think: How could you transform an undirected graph into a directed graph?
Yes, just give it a direction
STOP and Think: Can the Hash Table above ever get full (using seperate chaining?
depends on what is meant by “full”