Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Which of the following statements are TRUE. Let X = and Z = . Then Z is a sub

ID: 3685059 • Letter: 1

Question

1) Which of the following statements are TRUE.
      
Let X =

and Z = . Then Z is a subsequence of X.

      
Let X = , Y = , and Z = . Then Y is a common subsequence of X and Z.

      
Let X = and Y = . Let Z be a longest common subsequence (LCS) of Xm-1 and Yn-1. Then appending A to the end of Z produces an LCS of X and Y.

      
Let X = . Then X3 = .

2) What is the worst-case running time of the procedure PRINT-OPTIMAL-PARENS(s,1,n)?

      
?(1)

      
?(nlgn)

      
?(n)

      
?(n2)

3) We run the LCS-LENGTH(X, Y) function on the sequences: X = and Y =. We build the table c. What is the meaning of c[5,3] = 2 ? Select the correct answer below.

      
The length of an LCS of X5 and Y3 is 2.

      
X5 and Y3 have 2 characters in common.

      
The length of an LCS of X and Y is 2.

      
The length of an LCS of Y5 and X3 is 2.

4) Consider the binary search tree (BST) below, where each node has a label. Note that the label is NOT the key. The keys satisfy the BST property. Assume that all the keys are distinct.

Select all the statements below which are TRUE:

The list of nodes in the inorder-tree-walk is

N1, N4, N2, N7, N5, N8, N3, N6.

The successor of the node N2 is the node N7.

The predecessor of the node N6 is the node N3.

The height of the BST is 4.

N7 is the node with the minimum key.

The key of the node N4 is less than or equal to the key of the node N8.

The list of nodes in the inorder-tree-walk is

N1, N4, N2, N7, N5, N8, N3, N6.

The successor of the node N2 is the node N7.

The predecessor of the node N6 is the node N3.

The height of the BST is 4.

N7 is the node with the minimum key.

The key of the node N4 is less than or equal to the key of the node N8.

Explanation / Answer

Multipole Questions : Answering one (4th)

4)

The successor of the node N2 is the node N7.
The predecessor of the node N6 is the node N3.
The key of the node N4 is less than or equal to the key of the node N8.