Write the complete implementation of double ended queue (as discussed in class) containing the following functions:
- enqueueAtTail()
- dequeueAtTail()
- enqueueAtHead()
- dequeueAtHead()
- isEmpty()
- isFull()
- resizeQueue() //This function will double the size of the queue when it is 75% full and half the size of it when it is 25% full.
Note: you have to implement queue with integer array (not with pointers).
Task 2:
Use the queue you have implemented in Task 1 and write a code to convert an in-fix expression into post-fix expression. You have to implement the following 2 functions:
- convertInfixToPostfix()
- evaluatePostfix() //This function will take a post-fix expression as input and output its result.
No comments :
Post a Comment