1. Engineering
  2. Computer Science
  3. please explain for each question...

Question: please explain for each question...

Question details

1. What is the Big-Oh runtime in terms of N (number of inputs) for the following algorithm? HINT: It is not O(NA2) for (j = 0; j < N; ++) ) statement-o(1) statement - O (1) statement- 0 (1) 2. Convert the following expression from infix to postfix notation. You must show the stack and output at each step (make it look just like the example in the slides). (atb) (c-d*e+f) 3. Write a pseudocode algorithm to solve the following problem Given exactly 1 Queue (empty to begin with) and 1 Stack (full of unsorted integers), sort all of the values such that in the end, the Stack contains all of the original values in ascending order (top value will be the largest int) You may only use the ADT operations listed in the slides: Queue (enqueue, dequeue, getFront, size, isEmpty) Stack (push, pop, getTop, size, isEmpty) You may also use a constant number of int variables. Your algorithm must have a runtime of O(NA2) worst-case. (Hint: Think about how the selection sort algorithm works.) 4. What is the Big-Oh running time complexity of your algorithm in question 3. Explain. Be sure to explain the Big-Oh runtime of each step in the algorithm.please explain for each question

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution