Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Data Structures

Total questions: 24

Worksheet time: 12mins

Name
Class
Date
1.

Example of linear data structure except

a)

array

b)

tree

c)

queue

d)

stack

2.
_________________ is a collection of elements used to store the same type of data.
a)
Array
b)
Switch
c)
Case
d)
Loop
3.

Which of these data structures is LIFO?

a)

Stack

b)

Queue

c)

Binary Tree

d)

Double linked list

4.

int nums[ ] =

{2, 3, 5, 8, 9, 11};

How would you access the fourth element in nums

a)

nums[8]

b)

nums[3]

c)

nums(4)

d)

nums(3)

5.
Which of the following is NOT a Type of Data Structures?
a)
Arrays
b)
Tables
c)
Stacks
d)
Trees
6.
Storage for data defined in terms of set of operations to be performed on the data 
a)
Arrays
b)
Variables
c)
Abstract Data Types
d)
Algorithms
7.

A FIFO structure implemented as a ring where the front and rear pointers can wrap around the end of the start of the array.

a)

Linear Queue

b)

Circular Queue

c)

Priority Queue

8.

It use pointer to link nodes.

a)

Variable

b)

Link List

c)

Pointer

d)

Trees

9.

LIFO stands for

a)

List of Outputs

b)

Last in First Out

c)

First in Last Out

d)

None of them

10.

Act of adding values into a stack is called

a)

Popping

b)

Polling

c)

Pushing

d)

None

11.

If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

12.

Consider the following operation performed on a stack of size 5.


Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);


After the completion of all operation, get the total number of element present in stack is

a)

1

b)

2

c)

3

d)

4

13.
a)

circular linked list

b)

linked list

c)

doubly circular linked list

d)

doubly linked list

14.
What is a data structure?
a)
A method of arranging data
b)
A way of keeping data without an order?
c)
A "stack" only
d)
There is no formal definition for "Data Structure"
15.
What kind of Data structure would you expect to find utilised to store operations in a CPU?
a)
Stack
b)
Queue
c)
List
d)
Tree
16.
Which of these data structures is FIFO? 
a)
Stack
b)
Queue
c)
Binary Tree
d)
Double linked list
17.
A stack overflow is an undesirable condition in which a particular computer program tries to use more memory space than the called stack has available.
a)
True
b)
False
18.
What would 'leaving' a queue be called?
a)
"Dequeue"
b)
"Enqueue"
c)
"Leave queue"
d)
"Delete 'system 32' folder"
19.
What would a dynamic data structure entail?
a)
Memory is allocated to the data structure as the program executes.
b)
Memory is allocated to the data structure at compile time.
c)
The size of the structure is fixed
d)
The data structure can also double as TNT
20.
A strength of Linear searches is that they can be performed without sorting the list before hand... 
a)
True
b)
False
21.
A Binary search requires the data it is searching to be ordered in some way...
a)
True
b)
False
22.
For a ordered list of 11 items, how many comparisons will a linear search need before it knows that a value in NOT in the list?
a)
12
b)
11
c)
6
d)
4
23.
For a ordered list of 11 items, how many comparisons will a Binary search need before it knows that a value in NOT in the list?
a)
12
b)
11
c)
6
d)
4
24.
For a linked list, what meta-data will need to be stored with each data entry?
a)
The Name of the list
b)
The address of the current data entry
c)
The address of the next data entry in the list
d)
The meaning of life