This document provides instructions for Assignment 2 on stacks and queues. It includes 3 questions to apply concepts of stacks, priority queues, and deques to coding problems. Students must individually submit solutions by November 6 for evaluation. Closely following instructions and protecting original work is emphasized.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
28 views
Assignment 02 FA20
This document provides instructions for Assignment 2 on stacks and queues. It includes 3 questions to apply concepts of stacks, priority queues, and deques to coding problems. Students must individually submit solutions by November 6 for evaluation. Closely following instructions and protecting original work is emphasized.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Read before Attempt
Assignment No. 2: STACK AND QUEUE
Course code and Title: CSC211, Data Structure and Algorithm Instructor: Assigned Date: October 23, 2019 Due Date: November 6, 2019 Total Marks: -- CLO-2: Apply linear data structure to various practical problems. Instructions: 1. This is an individual assignment. You will submit your work individually through your logins (course portal) 2. Try to get the concepts, consolidate your concepts and ideas from these questions 3. You should concern recommended books for clarify your concepts as handouts are not sufficient. 4. Try to make solution by yourself and protect your work from other students. If I found the solution files of some students are same, then I will reward zero marks to all those students. 5. Deadline for this assignment is November 6, 2019. This deadline will not be extended.
Spring 2019 Page 1
Question # 1 (Applications of Stack) a) Convert the following infix expression into its equivalent postfix expression. Write each step of this conversion. 1. (A + B)*(C – D ) 2. A ^ B * C – D + E/F 3. A/(B+C*D-E) 4. A-B*C+D/E 5. (A+B)^2 -(C-D)/2 Evaluate the postfix expression (part a) when: A = 12 , B = 3 ,C = 7 , D = 4 ,E = 2 and F = 5 Question # 2 A priority Queue can be implement using following methods: 1. Using Array of Structure Where array elements of priority queue can have the following structure: struct data { int item; int priority; int order; }; 2. Using 2D Array 3. Linked List Write algorithms for insertion, deletion and display for above implementation methods Question # 3 A DEQUE is a data structure consisting of a list of items, on which the following operations are possible: PUSH ( X,D) : Insert item X on the front end of DEQUE D. POP(D) : Remove the front item from DEQUE D and return it. Inject(X, D) : Insert item X on the rear end of DEQUE D. Eject(D) : Remove the rear item from DEQUE D and return it. Write algorithms for above operations.