Answer the following questions about the list (2, 7, 1, 8, 2). a) What is the le
ID: 3810712 • Letter: A
Question
Answer the following questions about the list (2, 7, 1, 8, 2). a) What is the length? b) What are all the prefixes? c) What are all the suffixes? d) What are all the subsists? e) How many subsequences are there? If Land M are lists, under what conditions is LM = ML? Write pseudocode for dictionary operations insert, lookup, and delete using doubly-linked lists with duplicates. State the complexity of your algorithm. Explain each operation with proper examples (show boundary cases: item not found/found/duplicates/empty list). Simulate a stack evaluating the following postfix expressions. Show each step of your calculation. ab + cd +/ef - * Convert the infix expression to a postfix expression. a * b * c/e - f % x Write pseudocodes to implement enQueue(char), deQueuer(), queueOverflow(), queueUnderflow(), checkFront(), and checkRear() operations for a circular queue class that works with character data.Explanation / Answer
1)
a) Length is 5
b) prefix is : 2, 27, 271 , 2718 , 27182
c) Suffix is 2 , 82, 182 , 7182, 27182
d ) Sublist is : [2] [7] [1] [8] [2] .
[2,7] , [7 1] , [1 8 ] , [ 8, 2 ]
[2, 7 1] ,[ 7 1 8 ] , [1 8, 2 ]
[2 7 1 8] . [7 1 8 2]
e) There are 25 = 32 number of subsequences are there .
2) If they produces the same dot product and it can happen if the list is equal length
4)
AB+CD+/EF-*
1. A is operand so its pushed on to the stack
2. B is operand so its pushed on to the stack
3. Now we got + , so two elemnets are popped and result (A+B) is pushed on the stack.
4. C is operand so its pushed on to the stack
5. D is operand so its pushed on to the stack
6. Now we got + , so two elemnets are popped and result (C+D) is pushed on the stack.
7. Now we got / , so two elemnets are popped and result (A+B)/(C+D) is pushed on the stack.
8. E is operand so its pushed on to the stack
9. F is operand so its pushed on to the stack
10. Now we got - , so two elemnets are popped and result (E - F) is pushed on the stack.
11. Now we got * , so two elemnets are popped and result (A+B)/(C+D) * (E-F) is pushed on the stack.
Thats our answer
5. a*b*c/e-f%x
So we have (ab*) *c/e-f%x
=>(ab*c*)/e-f%x
=>(ab*c*e/)- f % x
=>(ab*c*e/)- fx%
=>ab*c*e/fx%-
Thats our answer:- ab*c*e/fx%-