![]() What is the time complexity to insert an element to the front of a LinkedList(head pointer given)? What is the best case time complexity of the binary search algorithm? What will be the output of the following code snippet? What is the time complexity of the Sieve of Eratosthenes to check if a number is prime? Maps in C++ are implemented using which of the following data structures? Kruskal’s Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a? What is the time complexity of the binary search algorithm? What will the output of the following code snippet be? Which of the following algorithms are useful for processing queries on trees? Using this getLCA() function, how can we calculate the distance between 2 nodes, given that distance from the root, to each node is calculated? ![]() Consider we have a function, getLCA(), which returns us the Lowest Common Ancestor between 2 nodes of a tree. Which of the following algorithms are used for string and pattern matching problems? Which of the following is known to be not an NP-Hard Problem? Which of the following are applications of Topological Sort of a graph? What will be the best sorting algorithm, given that the array elements are small (<= 1e6)? Which of the following is a Divide and Conquer algorithm? What is the maximum number of swaps that can be performed in the Selection Sort algorithm? Which of the following sorting algorithms provide the best time complexity in the worst-case scenario? Which of the following data structures allow insertion and deletion from both ends? Which of the following data structures finds its use in recursion? Which of the following data structures can be used to implement queues? What is the time complexity of the following code snippet in C++? When a pop() operation is called on an empty queue, what is the condition called? Which one of the following is an application of queue data structure What function is used to append a character at the back of a string in C++? Which of the following is the advantage of the array data structure? What is the output of the following code snippet? How are String represented in memory in C? What is the disadvantage of array data structure? What will the output of the following code snippet? From following which is not the operation of data structure? Which of the following is not the type of queue How is the 2nd element in an array accessed based on pointer notation? Which of the following is a linear data structure? How is an array initialized in C language? If anyone can figure it out please let me know. I was not able to figure what is wrong with my code. << " remaining repair orders in the queue)" Display the number of repair orders remaining in the queue when the “end-of-file” transaction is processed.Ĭout << "(output: There are " << iHeap.remain() A transaction containing the string “end-of-file” will signal the end of the input. A transaction that contains a “service” command results in a repair order being removed from the priority queue and the customer ID being displayed on the console. Each repair order is placed in a priority queue and will be serviced by the next available repair technician. A non-warranty repair order for a computer model older than 5 years is assigned a priority 3 (lowest). A non-warranty repair for a computer model less than 6 years old is assigned priority 2. A warranty repair order (i.e., warranty code = ‘y’) is assigned priority 1 (highest). Each repair order will be scheduled based on priority and the order in which the repair order was received (first-come-first-served). A new computer repair order will be represented in three parts separated by hyphens: customer ID (variable length), computer model year (4 digits), warranty code (y or n). This is the idea of the programĮach input transaction will represent a new computer repair order to be scheduled or a “service” command. I am using an array-based priority queue. I am trying to code a computer scheduling system with c++.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |