ArrayList
Stack
Link List
BST
Queue
100

Which statement is the correct declaration and initialization of an ArrayList of String values?


ArrayList<String> name;

name = new ArrayList<String>();

100

What best describes the stack paradigm?

FIFO

100

Part of a linked list that points to the first node if that list isn't empty  

Head
100

What method do you use to add a key-value pair into a HashMap?

put

100

What is the term for inserting into a full queue known as?

Overflow
200

Which of these is a key difference between arrays and ArrayLists?

Arrays are fixed size

 ArrayLists can change in size.

200

Which method looks at the top element??

Peak()

200

Four basic linked list operations:

 Traverse / Delete / Insert / IsEmpty

200

In which of the following cases, binary search algorithm is used?

To search an element in any ordered list with large number of elements.

200

 If the character 'V', 'I', 'V', 'A' are placed in queue (in order), and being removed one at a time, choose the order for the character after that

VIVA

300

What is the ArrayList nums if it is initially [5, 3, 1] and the following code is executed?

nums.add(6);

nums.add(0, 4);

nums.remove(1);

[4, 3, 1, 6]

300

 public class StackTest{ 

   public static void main(String[] args){      Stack<Integer> stack = new Stack<Integer>();            for(int i = 0; i < 10; i++)  

      stack.push(i);   

    stack.pop();   

   stack.pop(); 

     stack.pop();    } 

 }

6

300

In a(n) __________ list, each node has a pointer to the one before it and the one after it.

doubly

300

Draw figure below represent the binary tree of the following values: { 25, 18, 6, 12, 30, 27, 22, 32 }


300

A Queue can only store 6 data items. The Queue is sent 4 data items: Bert, Cynthia, Cedric and Albert. Where does the "Front" pointer point?

Bert

400

What is the correct  code to retrieve the first element in the nums ArrayList?

nums.get(0)

400

How many calls to pop() is need to determine the size of a stack? Answer in terms of n where n is the number of elements in the stack.

n(linear)

400

Appending vs inserting a node

Appending puts the node at the end / inserting can happen anywhere in the list

400

An array with 32 elements is input to a binary search algorithm. How many maximum number of comparisons are performed?

5

400

In linked list implementation of a queue, from where is the item deleted?

At the head of link list

500

What is printed after executing code on the nums ArrayList with the values [3, 2, 4, 5, 7]?

7

500

Which data structures can easily represent a stack?
Choose all that apply.

link list

Array

500

A data structure that points to an object of the same type as itself is known as a(n) __________ data structure.

Self-referential

500

Post order traversal :

1abc*+de*f+g*+

500

A queue of characters currently contained a,b,c,d. What would be the contents of queue after the following operationDELETE, ADD W, ADD X, DELETE, ADD Y.

C,D,W,X,Y

M
e
n
u