Question: JAVA 1 .Which one is NOT a available traversal algorithm? Select one: a. Doubly-linked list from first to last b. Singly-linked list from last to
JAVA
1 .Which one is NOT a available traversal algorithm?
Select one:
a. Doubly-linked list from first to last
b. Singly-linked list from last to first
c. Singly-linked list from first to last
d. Doubly-linked list from last to first
2 .Which data structure uses circular-array when implemented using Java arrays?
Select one:
a. Stack
b. Singly-Linked List
c. Queue
d. Doubly-Linked List
3 Which of the following is NOT an operation on Queue ADT?
Select one:
a. frontValue
b. dequeue
c. enqueue
d. topValue
4 What is the running time performance of binary search algorithm in big-Oh notation?
Select one:
a. O(N)
b. O(logN)
c. O(NlogN)
d. O(N2)
5 In Java programming, when we insert an item to the front of the queue, then:
Select one:
a. The queue will rearrange all items
b. This operation is not allowed
c. The new item automatically switches its position with the next item
d. Queue converts to FIFO organization
6 In Java programming, when we remove an item from bottom of the stack, then:
Select one:
a. This operation is not allowed
b. All items will be automatically rearranged
c. The item at the top will replace the removed item
d. The stack will convert to LIFO
7 Which ADT is best suited for storing method parameters, local variables, and return values in memory?
Select one:
a. Queue
b. Linked List
c. Stack
d. Freelist
8 What is the asymptotic running time of the following algorithm? public static long F(int n) { if (n == 0) return 0; if (n == 1) return 1; return F(n-1) + F(n-2); }
Select one:
a. Between O(n) and O(2n) linear
b. Between O(n 2) and O(n 3) polynomial
c. Between O(1.5 n) and O(2 n) exponential
d. None of the above
9 From the following four data structures, which one has the slowest insert operation?
Select one:
a. Insert at the head of a single linked list
b. Queue
c. Insert at the tail of a single linked list
d. Stack
10 Which of the following is NOT an operation on Stack ADT?
Select one:
a. push
b. frontValue
c. topValue
d. pop
11 An unsorted array of size 10,000 contains random integers in the range 10,000 .. 20,000. The program performs 100,000 searches where searched values are randomly selected from the range 10,000 .. 30,000. What will be the average number of comparisons when sequential search algorithm is used?
Select one:
a. 5,000
b. 7,500
c. 10,000
d. 50,000
12 Which of the following is NOT an O(nlogn) sorting algorithm.
Select one:
a. Merge Sort
b. Quick Sort
c. Heap Sort
d. Shell Sort
13 Which data structure allows two structures to be implemented using a single Java array?
Select one:
a. Queue
b. Doubly-Linked List
c. Stack
d. Singly-Linked List
14 Which of the following is not an appropriate strategy for tokenization?
Select one:
a. Using String objects split() method
b. Using Scanner objects next() method
c. Using StringBuilder Class
d. Using StringTokenizer class
15 Given their time complexity, which of the following algorithms will be the fastest?
Select one:
a. O(N)
b. O(logN)
c. O()
d. O(loglogN)
16 From the following four data structures, which one has the slowest remove operation?
Select one:
a. Queue (operation dequeue)
b. Stack (operation pop)
c. Single Linked List (remove the last element)
d. Single Linked List (remove the first element)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
