Question
16. When do we use an adjacency list? a. When sorting a list b. For a graph that is undirected c. For a hash table
16. When do we use an adjacency list?
a. When sorting a list
b. For a graph that is undirected
c. For a hash table
d. When searching through a list for an element
17. Which data structure is used to convert an infix expression to prefix or postfix? a. Stack b. Priority queue c. Linked list d. Hash table
18. Which algorithm sorts the following list [5 3 9 7] using the steps of: [5 3 9 7] -> [3 5 9 7] -> [3 5 9 7] -> [3 5 7 9] -> [3 5 7 9]? a. Merge sort b. Insertion sort c. Binary search d. Bubble sort
19. What is the Big-O for an algorithm that takes two arrays of equal size n, and returns true if the arrays are disjointno elements in commonby taking an element from the first array and then checking if it is in the second array? a. O(n!) b. O(n^2) c. O(n^3) d. O(2^n)
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