

Problem 1. (15 points) Apply the DFA minimization algorithm to the DFA shown below. Show the...
(15 points) Consider the algorithm for insertion sort shown below. The input to this algorithm is an earray A. You must assume that indexing begins at 1. 1: for j = 2: A.length do key = A i=j-1 while i > 0 and A[i] > key do Ali + 1] = Ai i=i-1 7: A[i+1] = key (a) Follow this algorithm for A[1..4) =< 7,9,6,8 >. Specifically, please indicate the contents of the array after each iteration of the outer...
Problem 2. Apply Dijkstra's least-cost or shorted-path algorithm to the network shown on the right. Complete the table by filling the T, Lin), and Path on each row to show the result of each iteration. Result of the last iteration, 6, is already provided in red as a way to help you to verify if your iterations are performed correctly. (1 point each box, 30 points in total) Iteration I L(2) Path L(3) Path L(4) Path L(5) Path LO Path...
3. Apply the Huffman algorithm according to the frequency chart shown below. (10 points) a. Show your work for combining the characters and frequencies. b. Assemble and show the finished tree. c. State the encoding for each character. d. Show your calculation and state the compression ratio. e. Using your Huffman tree from this question, encode the string ABACABAD. f. Using your Huffman tree from this question, decode the bit-string 100010111001010. symbol A B C D frequency 0.4 0.1 0.2...
1. (20 points) Consider the network shown below, and assume that each node initially knows the costs to each of its neighbors. Consider the distance-vector algorithm and show the distance table entries at each node iteration by iteration until the algorithm converges at all nodes. 10 Iteration 0 Iteration 1 Iteration 2 Iteration n (trust me, n won't be crazily too large)
Problem 3. (15 points) Consider the circuit shown below. The arrows show the assumed direction of the current flow 352 5Ω 2 S2 352 12 21 (i) Apply Kirchoff's junction rule and Kirchoff's loop rule to find the necessary set of equations required to solve for the currents, i. Write the equations in matrix form Clearly write out A and b. [Note: This is not the most efficient way to solve this problem. We are not trying to be efficient,...
Apply the topological sort algorithm to the graph. Follow the
algorithm in you textbook and clearly show the content of the three
lists: resultList, noIncoming and remainingEdges after each
iteration.
2. Apply the topological sort algorithm to the graph below. Follow the algorithm in you textbook and clearly show the content of the three lists: resultList, nolncoming and remainingEdges after each iteration GraphTopologicalSort (graph) { resultList = empty list of vertices no Incoming = list of all vertices with no...
Question2 in the photo. Please help. Thanks
1. Construct an NFA that accepts the language La = {zaaabyaaabzla, y, z E {a, b)' } 2. Eliminate the e-transitions (denoted as E's below) from the following NFA s.t. the resulting machine accepts the same language with the same mumber of states. ql a,b go q3 2 3. Text problem: page 62, number 3. Finish by reducing the DFA. Note that you may want to do this in stages, first eliminating the...
Problem 4: Sorting and Searching (55 points) a) (20 points) Scarch for the character K using the binary search algorithm on the following array of characters: KM 2. R For each iteration of binary search use the table below to list: (a) the left index and (b) the right index of the array that denote the region of the array that is still being searched, (c) the middle point index of the array, and (d) the number of character-to-character comparisons...
13. (10 points) Apply dijkstra's algorithm to the digraph shown below in order to find the shortest path from S to T. A BE 7 8 E 3 00 5 4 S 6 T 9 9 D
Java
We did in lecture, and explain your answer briefly. Problem 4: Sorting practice 14 points; 2 points for each part individual-only Important: When answering these questions, make sure to apply the versions of these algorithms that were discussed in lecture. The Java code for each algorithm can be found in our Sort class. Given the following array: {14, 7, 27, 13, 24, 20, 10, 33 1. If the array were sorted using selection sort, what would the array look...