Algorithms

Insert {1, 2, 5, 10, 17, 25, 36, 49} into empty hash table with Table Size = 16 using

a. Linear Probing

b. Quadratic Probing

a. Linear Probing

b. Quadratic Probing

Algorithms

1. Insert {1, 2, 5, 10, 17, 25, 36, 49} into empty hash table with Table Size = 16 using

a. Linear Probing

b. Quadratic Probing

a. Linear Probing

b. Quadratic Probing

Algorithms

1. Insert {1, 2, 5, 10, 17, 25, 36, 49} into empty hash table with Table Size = 16 using

a. Linear Probing

b. Quadratic Probing

2. If the nested parenthesis representation of a tree is as follows, (A (B (E, F (J, K ) ), C ( G ( L ) ), D ( H, I ( M ) ) ) ) then

a. what is the graphical representation of the tree?

b. determine the height of the tree

c. what is the degree of the tree?

d. what is the maximum number of nodes at the level 2?

e. what is the maximum number of nodes the tree can hold?

f. Draw the array representation of the tree

g. Give the preorder representation of the tree

3.a. Differentiate between program and algorithm

b.

i. Write the algorithm for searching unsorted linked list

ii. What is the running time of this algorithm (the algorithm in i above)?

c. Explain the following (give examples where necessary):

i. PUSH

ii. QUEUE

iii. TOP

iv. POSTFIX EXPRESSION

a. Linear Probing

b. Quadratic Probing

2. If the nested parenthesis representation of a tree is as follows, (A (B (E, F (J, K ) ), C ( G ( L ) ), D ( H, I ( M ) ) ) ) then

a. what is the graphical representation of the tree?

b. determine the height of the tree

c. what is the degree of the tree?

d. what is the maximum number of nodes at the level 2?

e. what is the maximum number of nodes the tree can hold?

f. Draw the array representation of the tree

g. Give the preorder representation of the tree

3.a. Differentiate between program and algorithm

b.

i. Write the algorithm for searching unsorted linked list

ii. What is the running time of this algorithm (the algorithm in i above)?

c. Explain the following (give examples where necessary):

i. PUSH

ii. QUEUE

iii. TOP

iv. POSTFIX EXPRESSION

Algorithms

a. Using Cohen-Sutherland algorithm,

Let, the rectangular window A (15, 15), B (80, 15), C (80, 60), D (15, 60). Find the region codes, slope, intersection points to clip the line with P1(10,20) and P2(70, 80).

b. Calculate the dot product of a= (22, 2, 7) & b= (12, -9, 11). And Cross Product of c= (4, 0, 3) & d= (3, 1, 7).

Let, the rectangular window A (15, 15), B (80, 15), C (80, 60), D (15, 60). Find the region codes, slope, intersection points to clip the line with P1(10,20) and P2(70, 80).

b. Calculate the dot product of a= (22, 2, 7) & b= (12, -9, 11). And Cross Product of c= (4, 0, 3) & d= (3, 1, 7).

Algorithms

Calculate the dot product of a= (22, 2, 7) & b= (12, -9, 11). And Cross Product of c= (4, 0, 3) & d= (3, 1, 7).

Algorithms

Using Cohen-Sutherland algorithm,

Let, the rectangular window A (15, 15), B (80, 15), C (80, 60), D (15, 60). Find the region codes, slope, intersection points to clip the line with P1(10,20) and P2(70, 80).

Let, the rectangular window A (15, 15), B (80, 15), C (80, 60), D (15, 60). Find the region codes, slope, intersection points to clip the line with P1(10,20) and P2(70, 80).

Algorithms

Given the function; F(W,X,Y,Z)=sum(1,3,7,11,15)+dc(0,2,5,8).

(i) write the function in conjunctive normal form.

(ii)Minimize the function (DNF) using Karnaugh Map.

(iii)Construct the logic circuit diagram for the minimized function.

(i) write the function in conjunctive normal form.

(ii)Minimize the function (DNF) using Karnaugh Map.

(iii)Construct the logic circuit diagram for the minimized function.

Algorithms

compute -ABE(base16)-AF4(base16)using 15's complement

Algorithms

All of your solutions should be structured. Explain why your solution can be considered a structured solution

Algorithms

a) Compute - ABE16 - DF416 using 15’s complement

b) Compute the 3658-3458 in 2’s complement signed magnitude form.

c) Simplify the expression

using rules of Boolean algebra.

d) Compute the value of 3AB16-43510-6178 using 1’s complement arithmetic

leaving your final answer in Octal.

f (a, b, c) = a. b + a.(b + c)+(a. b. (c + b. d)+ a. b). c. d

b) Compute the 3658-3458 in 2’s complement signed magnitude form.

c) Simplify the expression

using rules of Boolean algebra.

d) Compute the value of 3AB16-43510-6178 using 1’s complement arithmetic

leaving your final answer in Octal.

f (a, b, c) = a. b + a.(b + c)+(a. b. (c + b. d)+ a. b). c. d