Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DSA Basics

Total questions: 65

Worksheet time: 1hrs 5mins

Name
Class
Date
1.

Example of linear data structure except

a)

array

b)

tree

c)

queue

d)

stack

2.
Which of the following is NOT a Type of Data Structures?
a)
Arrays
b)
Tables
c)
Stacks
d)
Trees
3.
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
4.
What would 'leaving' a queue be called?
a)
"Dequeue"
b)
"Enqueue"
c)
"Leave queue"
d)
"Delete 'system 32' folder"
5.
_________________ is a collection of elements used to store the same type of data.
a)
Array
b)
Switch
c)
Case
d)
Loop
6.
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"
7.

Which of the following are examples of Data Structures?

a)

Linear List

b)

Linked List

c)

Stacks

d)

Trees

e)

Pseudocodes

8.

What do you this data structure classification in which the elements are stored/accessed on a non-linear order such as trees and graphs.

a)

trees

b)

linear

c)

non-linear

d)

graphs

9.

Which of these in NOT a linear data structure?

a)

Tree

b)

Stack

c)

Array

d)

Queue

10.

The two major factors of data structure complexity are:

a)

time and location

b)

type and size

c)

time and memory

d)

type and space

11.
Given the complexity of a sorting algorithm is О(n2), what does the n represent?
a)
number of items in total
b)
number of items being sorted
c)
number of iterations
d)
None of the above
12.
What does LIFO stand for?
a)
List in First out
b)
List in False out
c)
Last in First out
d)
None of the above
13.
Which of the following is a/are dynamic data structure(s)?
a)
Linked List
b)
Heap
c)
Array
d)
Both 1 and 2
14.
Which of the following operation(s) is/are performed on queues?
a)
init()
b)
enqueue()
c)
dequeue()
d)
All of the above
15.
Linear search is more efficient than a Binary search.<br />Determine the above statement as true or false.<br />
a)
true
b)
false
c)
Partially True
d)
None of the above
16.
Null and Void are similar.<br />Determine above statement as true or false.
a)
true
b)
false
c)
Partially True
d)
None of the above
17.
What is proved by answering the below question?<br />Are you the type of candidate who will always be there to solve the problem on your own before asking for help?<br />
a)
Individual capability of solving a problem
b)
Collaboration with team for a help
c)
Either 1 or 2
d)
None of the above
18.
In your terms, what makes any person a good problem solver?
a)
Understanding the problem before rushing to solve
b)
Identify and Analyse the actual tough part of problem
c)
Either 1 or 2
d)
None of the above
19.
You are assigned a problem but are not able to solve in time. What do you do in this kind of situation?
a)
Ask teammates for the help
b)
Report supervisor, asking for extra time and resources
c)
Either 1 or 2
d)
None of the above
20.
Which of the following would be considered as a problem faced frequently by many applications ?
a)
Data Search
b)
Processor speed
c)
Multiple requests
d)
All of the above
21.
Which of the following could be considered as an application of Data Structures?
a)
Insert
b)
Sort
c)
Delete
d)
All of the above
22.
Which of the following belongs to time complexity in data structures and algorithms?
a)
Worst Case
b)
Average Case
c)
Best Case
d)
All of the above
23.
Which of the following is the best-case complexity of binary search?
a)
O(1)
b)
O(log n)
c)
O(log 10)
d)
All of the above
24.
Which of the following is the average-case complexity of Merge sort?
a)
O(1)
b)
O(n*Log n)
c)
Either 1 or 2
d)
Neither 1 nor 2
25.
Best, Average and Worst complexity of Merge sort are the same.<br />Determine the above statement as true or false.
a)
true
b)
false
c)
Partially True
d)
None of the above
26.
Which of the following is the worst-case complexity of Bubble sort?
a)
О(n2)
b)
O(log n)
c)
O(1)
d)
None of the above
27.
Which of the following is a/are limitation(s) of Stack in data structures?
a)
No Random Access
b)
Risk of Stack overflow
c)
Very Limited memory
d)
All of the above
28.
Which of the following is a/are disadvantage(s) of LinkedList?
a)
Requires larger memory size
b)
Sequential Access
c)
Both 1 and 2
d)
Only 2
29.
To select a data structure for any development activity, which of the following features would you consider for the data structure to be good in?
a)
Easy Access
b)
Space Occupancy
c)
Both 1 and 2
d)
Only 1
30.
Which of the following languages doesn't have pointers?
a)
Java
b)
C
c)
C++
d)
None of the above
31.

If you want the method to return a value, you can use a primitive data type instead of void, and use the (a)   keyword inside the method.

(use small letters and space if necessary)

32.

A data structure which is a programming technique you can use in which a method calls itself to solve a problem.

(use small letters and space if necessary)

(a)  

33.

(a)   is a collection of elements used to store the same type of data.

(use small letters and space if necessary)

34.

int num[ ] = {11, 2, 99, 4, 33, 14, 18};

How would you access the fourth element in num.

(no spacing in writing the answer)

(a)  

35.

A recursive method is ________

a)

a method that cannot be called more than once

b)

a method that will never iterate infinitely

c)

a method that invokes itself by name within the method

36.

Index values of an array ranges from ________.

a)

0 to length

b)

1 to length

c)

1 to length

d)

0 to length-1

37.

The program may run out of memory in a ___

a)

non-recursive function call

b)

condition when too many variables are declared

c)

recursive function call

d)

none of the above

38.

Which of the following problems can be solved using recursion?

a)

finding the factorial of a number

b)

finding Nth number of the Fibonacci sequence

c)

finding the length of a string

d)

all of the above

39.

(a)   act as variables inside the method.

(plural form, use small letters and space if necessary)

40.

Name the condition at which the recursive method will stop calling itself.

(use small letters and space if necessary)

(a)  

41.

float numarr[4];

What is the range of the index?

(use numerical value and write "to" in-between the range, use space if necessary)

(a)  

42.

When a parameter is passed to the method, it is called an (a)   .

(singular form, use small letters and space if necessary)

43.

int[] arr;

Write the instantiating code with the length of 5.

(use proper symbol, space before and after "=" symbol)

(a)  

44.

What is the error in the following code fragment?

float ave[20];

ave[20]=10.44;

a)

a cast is required

b)

a two-dimensional array is required

c)

data not initialized

d)

array out-of-bounds

45.

What would happen if the base case if not defined in the recursive method?

a)

stack underflow

b)

index out of bounds

c)

stack overflow

d)

none of the above

46.

What is the output?

(a)  

47.

Methods are used to perform certain actions, and they are also known as (a)   . (plural form, use small letters and space if necessary)

48.

Java code to display the size of an array name studname[ ].

a)

System.out.println("The size is " + studentname[ index ]);

b)

System.out.println("The size is " + length.length);

c)

System.out.println("The size is " + studentname);

d)

System.out.println("The size is " + studname.length);

49.

Identify the name of the array based on the code segment below:

for(int j=0; j<studnum.length; j++) {

System.out.print("Enter student number: ");

(a)  

}

50.

Insert the missing part in creating and instantiating an array.

int[] arr = { 77, 22, 44}

(a)  

51.

An algorithm should be in the right order.

Write T if the statement is TRUE otherwise F.

(a)  

52.

A mathematical-model with a collection of operations defined on that model is called _____.

a)

algorithm

b)

data structure

c)

data type

d)

abstract data type

53.

When you write an algorithm you need to include ________, step-by-step instructions.

a)

ambiguous

b)

multiple

c)

clear

d)

precise

54.

It is a property to get the size of an array.

(use small letters and spacing if necessary)

(a)  

55.

double[][] arr = {{4.2, 4.3, 4.0}, {4.1, 4.4} };

What is the element in arr[1][0] ?

(a)  

56.

Algorithm is a

a)

Step by step procedure

b)

difficult procedure

c)

complex

d)

hard steps

57.

Flowchart are ____________________________ in nature.

a)

Easy

b)

Simple

c)

Complex

d)

Hard

58.

______________________ is a pictorial representation of steps.

a)

Algorithm

b)

Flowchart

c)

Connectors

d)

Flowlines

59.

(a)   are used to connect the boxes.

60.

We use different boxes in

a)

steps

b)

flowchart

c)

algorithm

d)

quiz

61.

Flowcharts are from

a)

Left

b)

Right

c)

Bottom

d)

Top to bottom

62.

____________________________ must be organized properly.

a)

Puzzle

b)

Quiz

c)

Flowchart

d)

Algorithm

63.

We use this in the beginning of an Algorithm & Flowchart.

a)

Start box

b)

Stop box

c)

Decision

d)

Flowlines

64.

Which box is used for processing instructions.

a)

Input

b)

Algorithm

c)

Decision

d)

Processing

65.

Which box is used for accepting inputs or giving output?

a)

Start

b)

Stop

c)

Input Output

d)

Condition