Docsity

Solved Quiz 8 - Data Structures and Algorithms | ECE 2574, Quizzes of Data Structures and Algorithms

Partial preview of the text

Download Solved Quiz 8 - Data Structures and Algorithms | ECE 2574 and more Quizzes Data Structures and Algorithms in PDF only on Docsity!

ECE 2574 Quiz 8 (Please do not write your SS# or your VT Passport ID# on this paper} (d Pick the false completion for questions 1-2. icks and queues: on ene include time stamps on data elements so that they know what was added when . are called linear data structures. . require just three methods each for adding, removing and peeking. . force data to be added to and removed from particular ends of the data structure, an 2. Ifa stack is implemented as ... we a. an ArrayList then pushing a new entry in the worst case may take time proportional to the current size of the stack b. a linked list then add and remove cap stack, pravided capacity is not ex led. nation usesa circular array can an a ray tren re preferred lye be done in time independent of the current size of the Pick the true completion for questions 3 & 4, 3. Ifthe numbers 5, 10, 3, 42 are pushed onto a stack in that order, what does pop return? a. 5 b. 10 4 a 3 d. 42 v 4. tf the numbers 5, 10, 3, 42 areénqueued onto a queue in that order, what does dequeue return? b. on 2 d.° 42 >. Convert the expression 1—(6+3*5)/3_ into a postfix notation. Show the steps by drawing the or Ff the stack at every step of the conversion process, e BS [S o) 6 6 ¢ A 2] ; fA “