Showing posts with label Queue. Show all posts
Showing posts with label Queue. Show all posts

Wednesday, 3 May 2017

DSA Lab 5 - Linked List

Task 1:

Write the complete implementation of double ended queue by using linked list (as discussed in class) containing the following functions:

  • enqueueAtTail()
  • dequeueAtTail()
  • enqueueAtHead()
  • dequeueAtHead()
  • isEmpty()
  • isFull()
  • resizeQueue()   // do you really need this function?? think about it!

PS: Best of luck for your mid term lab exam. Don't be late in exams!

Friday, 21 April 2017

DSA Lab Assignment 1 - Time and space complexity of different data structures & algorithms

Q 1:

Write the time and space complexity of the following data structures:

  • Array
  • Stack
  • Queue
  • LinkedList
  • HashTable
  • BinarySearchTree
  • AVL
Also write the time complexity of Insertions, Deletion and Access operations of above mentioned data structures.


Q 2:

Write the time and space complexity of the following algorithms:
  • Quick Sort
  • Selection Sort
  • Bubble Sort
  • Merge Sort
  • Insertion Sot
  • Linear Search
  • Binary Search

DSA Lab 3 - Queue & Post-fix In-fix expressions

Task 1:

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.