Question: C programming a) Consider the following given queue in Figure 2 which have FRONT=1 and REAR-5. The items in the queue are implemented using array.

C programming

C programming a) Consider the following given queue in Figure 2 which

a) Consider the following given queue in Figure 2 which have FRONT=1 and REAR-5. The items in the queue are implemented using array. According to the given queue, illustrate the items and analyse the FRONT and REAR in the queue if the following operations were performed sequentially: Add 8 Add 13 iii. Delete four items Delete two items Add 11 i. iv. v. FRONT REAR 10 2 2 8 Figure 2: Items in Queue (10 Marks) b) The prefix expression can be evaluated using queue. Evaluate the following infix expression by: Infix expression: 10.2-2+8/4 i. ii. Convert the infix to postfix expression Evaluate the prefix expression using queue. Complete Table 1 to evaluate prefix expression. Prefix Ch Opr Opn1 Opn2 Result Queue Table 1: Prefix expression evaluation (15 Marks) a) Consider the following given queue in Figure 2 which have FRONT=1 and REAR-5. The items in the queue are implemented using array. According to the given queue, illustrate the items and analyse the FRONT and REAR in the queue if the following operations were performed sequentially: Add 8 Add 13 iii. Delete four items Delete two items Add 11 i. iv. v. FRONT REAR 10 2 2 8 Figure 2: Items in Queue (10 Marks) b) The prefix expression can be evaluated using queue. Evaluate the following infix expression by: Infix expression: 10.2-2+8/4 i. ii. Convert the infix to postfix expression Evaluate the prefix expression using queue. Complete Table 1 to evaluate prefix expression. Prefix Ch Opr Opn1 Opn2 Result Queue Table 1: Prefix expression evaluation (15 Marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!