Answered step by step
Verified Expert Solution
Question
1 Approved Answer
help with that please, you can number then a,b,c...as they follow each other Those questions changes with pictures one pictures is one questions and others
help with that please, you can number then a,b,c...as they follow each other
Those questions changes with pictures one pictures is one questions and others you realize they are two in one
Sort the following functions in increasing order of growth following the Big-O notation (Please see attached if it is not displaying properly on your screen). (NB: There is no need typing the functions, just use the labels (a) to (h) to sort the functions accordingly.) a. logloglog(n) b. n3log(n) c. 4.5(n) d. 3(n) e. n(4)log(n) f. loglog(n) g. 4.5n+log(n) h. 3(500) a. logloglog(n) b. n3log(n) c. 4.5(n) d. 3(n) e. n(4)log(n) f. loglog(n) g. 4.5n+log(n) h. 3(500) An important application area of stacks is in the parsing phase in compilers. Evaluate the following postfix expression using a stack: (NB: show your workings step by step) 596+427+3+ public static void main(String[] args) \{ Stack postfix = new Stack ( ); postfix.add("596"); postfix.add("42**7"); postfix.add("3*"); \} Tail recursion is useful because it can be implemented more efficiently than general recursion. Which of the following algorithms (A or B) is tail recursive? (Please justify your answer.) Algorithm A long rec2(int a, int b ) \{ If (b=0){ return a; \} return rec2(a*b, b+4) \} Algorithm B int rec1(int a, int b)\{ If (b==1){ return 1; \} int c=rec1(a,b1) return (a%c) \} Algorithm A Because the last action on the rec2 function called or return itself Show the state of the queue with the corresponding characters during the following sequence of queue operations, if executed on an initially empty queue? CSC211REMOTE Stacks and queues are limited access data structures. True or False? (Justify your answer) Suppose an initially empty stack, S, has performed a total of 75 push() operations, 5 peek() operations and 10 pop operations, 4 of which returned null to indicate an empty stack. What is the current size of the stack, S? (Explain your answer/Show your workings) Consider the following linked list and write an algorithm/function to determine the node just before the tail node. [A]>[P]>[R]>[k]>NULL The type of recursion implemented in the following code is a tail recursion (True or False) ? Please explain/ justify your answer. public class ClassTest \{ public int test(int val) \{ if (val[P]>[R]>[k]>NULL Comment:No Submission \begin{tabular}{l|l} 0.0 & 3.0 Points \end{tabular} Suppose the original attempt to insert an element into a hash table of size 11 fails, where the initial hash function computation, h(k), is 9 (i.e. h(k)=9 ). In an attempt to resolve collision using_quadratic probing, the first probe point also fails. What alternative index location will then be considered for the next possible insertion? Comment:No Submission 0.0 2.0 Points If the last index of a hash table is p4, where p is a positive integer value, what is the size of the hash table? (NB: Express your answer in terms of p ) Comment:No Submission Consider the following pseudocode below (where A is an array of size N). Identify and explain any problem(s) in the logic of the pseudocode. Fix the problem by rewriting the pseudocode correctly. for iA[i+1]) \{ Swap(A[i],A[i+1]) \} \} Comment:No Submission Consider the two hash functions (A and B) given below (Please see the attached file if it is not displaying correctly on your screen): AB=(d1+d2)=((d1)2+7d2) Suppose Company XYZ wants to store information about some employees in its sales department, and d1 and d2 denote the first and second digits of an employee ID respectively. Which of the two hash functions is a better choice for company XYZ, and why? (Please explain your answer) Consider the two hash functions ( A and B ) given below: A=(d1+d2)B=((d1)2+7d2) Comment:No Submission Question 14 of 14 0.0 2.0 Poin Suppose an initially empty queue, Q, has performed a total of 68 enqueue() operations, 20 peek() operations, and 13 dequeue() operations, 5 of which returned null to indicate an empty queue. What is the current size of Q? (Explain your answer/Show your workings)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started