wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

UTSDSA

Total questions: 100

Worksheet time: 2hrs 40mins

Name
Class
Date
1.

It is a specialized way of storing and organizing data in a computer so that it can be used efficiently.

a)

Data Structure

b)

Data Type

c)

Variables

2.

It is a step by step process to solve a given problem. Take the simplest example below.

a)

Pseudo code

b)

Programming

c)

Algorithm

3.

It is a measure of how well a computer algorithm scales as the amount of data involved increases.

a)

Big logN Notation

b)

Big X Notation

c)

Big O Notation

4.

In this type of search, a sequential search is made over all items one by one.

a)

Search

b)

Binary Search

c)

Linear Search

5.

It is the process of arranging a list of elements in a particular order.

a)

Search

b)

Sorting

c)

Elements

6.

2. _________________ is a collection of elements used to store the same type of data.

a)

Array

b)

Switch

c)

Case

d)

Loop

7.

6. Which of the following is the correct operator to compare two variables?

a)

equal

b)

=

c)

:=

d)

==

8.

A queue is a _________ data structure in which each element that was inserted first is the first one to be taken out.

a)

FITO

b)

FIFO

c)

FISO

d)

FIVO

9.

_________ operation removes the element from the top of the stack.

a)

push

b)

pop

c)

update

d)

none of the above

10.

_________ operation adds an element to the top of the stack.

a)

pop

b)

push

c)

peep

d)

all of the above

11.

Full form of LIFO is ____________

a)

Last Inside First Outside

b)

Last Innner First Outer

c)

Last In First Out

d)

Last Impact First Out

12.

Stack uses __________ data structure as the element that was inserted last is the first one to be taken out.

a)

LIPO

b)

FIFO

c)

LIFO

d)

FIPO

13.

____________data structures are those whose sizes and structures associated memory locations are fixed at compile time.

a)

linear

b)

homogeneous

c)

static

d)

dynamic

14.

In ____________ data structure, the data items are arranged in a linear sequence.

a)

linear

b)

non linear

c)

both a and b

d)

all of above

15.

_____________ specifies how we enter data into our programs and what type of data we enter.

a)

data type

b)

data

c)

datum

d)

all of above

16.

People have used the word ________ to mean computer information that is transmitted or stored.

a)

Beta

b)

Data

c)

Database

d)

None of above

17.

In linked list each node is divided into ___________parts?

a)

one

b)

two

c)

three

d)

four

18.

Which data structure allows deleting data elements from front and inserting from rear?

a)

Stack

b)

Queue

c)

Array

d)

Linked List

19.

The disadvantage in using a circular linked list is __________

a)

it is possible to get into infinite loop

b)

last node points to fist node.

c)

time consuming

d)

requires more memory space.

20.

In a Queue Data Structure...

a)

New elements may only be added to the end of the queue

b)

Elements may only be retrieved from the front of the queue.

c)

Elements may only be retrieved from the end of the queue.

d)

New elements may only be added to the front of the queue

21.

Select operations that can be performed on a Queue Data Structure...

a)

isEmpty()

b)

pop()

c)

push()

d)

isFull()

e)

Append(Item)

22.

What is the starting index of items in an array in most programming languages?

a)

Index 1

b)

Index 0

c)

Index -1

d)

Index 10

23.
How does a Linked List handle memory differently from an Array?
a)
It reserves memory at the beginning
b)
It uses a larger memory space
c)
It doesn't allow memory resizing
d)
It dynamically allocates memory
24.
What operation is used to add an element in a Queue?
a)
Pop
b)
Enqueue
c)
Peek
d)
Push
25.
What sorting algorithm would be suitable for a small list of items?
a)
Quick Sort
b)
Merge Sort
c)
Bubble Sort
d)
Heap Sort
26.
What is the main advantage of using Linked List over Array?
a)
Linked List has a fixed size
b)
Linked List allows direct access to elements
c)

Linked List is dynamic in nature

d)
Linked List uses less memory
27.
What data structure operation allows you to check the top element without removing it?
a)
Peek
b)
Enqueue
c)
Dequeue
d)
Pop
28.
Which sorting algorithm is most efficient for large data sets that are mostly sorted already?
a)
Bubble Sort
b)
Selection Sort
c)
Insertion Sort
d)
Quick Sort
29.

The correct number stack of (4 + 6) * 3 is…

a)

b)

c)

d)

30.

Which real-life example represents a queue?

a)

Stack of dishes in the kitchen

b)

Queue of customers at cashier

c)

A list of phone contacts

d)

File storage

31.

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

32.
a)

circular linked list

b)

linked list

c)

doubly circular linked list

d)

doubly linked list

33.

Figure Speak

a)

Processing box

b)

Start/stop box

c)

Input / Output box

d)

Decision / condition box

34.

Figure Speak

a)

Input / Output box

b)

Start/stop box

c)

Decision / condition box

d)

Processing box

35.

Figure Speak

a)

Processing box

b)

Input / Output box

c)

Start/stop box

d)

Decision / condition box

36.

It is used for accepting input or giving output of the program.

a)
b)
c)
d)
37.

It is used for writing the processing instructions and doing calculations.

a)
b)
c)
d)
38.

Which algorithm matches this description: "a sorting algorithm that treats the input as two parts, a sorted part and an unsorted part, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part."

a)

Selection Sort

b)

Radix Sort

c)

Insertion Sort

d)

Binary Sort

39.

Which algorithm matches the description: "is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item, until you've narrowed down the possible locations to just one."

a)

Linear Search

b)

Binary Search

c)

Bubble Search

d)

Straight Search

40.

What is the degree of complexity ( Big O() )  of the linear search algorithm?.

a)

O(nn)O\left(n^n\right)  

b)

O(n log 2)

c)

O(n2)O\left(n^2\right)  

d)

O(n)

41.

What is a disadvantage of the binary search algorithm?

a)

The elements to search needs to be sorted first.

b)

The elements to search do not have to be sorted

c)

Difficult to understand and implement

d)

It uses recursion

42.

What is the correct statement about selection sort?.

a)

Can sort alphabetically, and numerically (ascending or descending)

b)

Can only sort numeric (ascending or descending)

c)

Can only sort alphabetically

d)

None of the above

43.

What is a disadvantage of the bubble sort algorithm?

a)

Easy to understand and implement

b)

It is inefficient due to the number of exchanges.

This makes it slow for large arrays

c)

Sometimes it does not work

d)

Elements need to be sorted in order to be used.

44.

What is the degree of complexity ( Big O() ) for the Bubble sort algorithm?.

a)

O(n2)O\left(n^2\right)

b)

O(n)O\left(n\right)

c)

O(2n)O\left(2n\right)

d)

O(N log 2)O\left(N\ \log\ 2\right)

45.

Which of the following best describes a characteristic of a good algorithm?

a)

It should be complex and lengthy

b)

It should be efficient and clear

c)

It should be ambiguous

d)

It should be difficult to understand

46.

Which of the following best represents the correct algorithm for cooking instant noodles?

a)

Boil water → Put noodles → Add seasoning → Stir → Serve

b)

Put noodles → Add seasoning → Boil water → Stir → Serve

c)

Add seasoning → Stir → Boil water → Put noodles → Serve

d)

Serve → Add seasoning → Put noodles → Boil water → Stir

47.

Which of the following best represents the algorithm for making a cup of tea?

a)

Pour hot water → Put tea bag → Add sugar → Stir

b)

Stir → Pour hot water → Add sugar → Put tea bag

c)

Add sugar → Stir → Put tea bag → Pour hot water

d)

Put tea bag → Stir → Add sugar → Pour hot water

48.

Which of these is the best description of a list in Python?

a)

A list is a collection of data that has an order and can be changed

b)

A list is a lot of variables

c)

A list is used for shopping

d)

A list is a collection of data that cannot hold duplicated data and cannot be changed

49.

Which of these is the correct code for creating a list of names?

a)

nameList = John, Harry, Jesse, John, Harry, Harry

b)

nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")

c)

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

d)

nameList = [John, Harry, Jesse, John, Harry, Harry]

50.

Which of these pieces of code would return the name "Harry" from the following list?

nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]

a)

nameList()

b)

nameList[1]

c)

NameList(4)

d)

nameList["4"]

51.
What data type is this?
quiz = {"Do you help out at home? ":"yes",        
"Do you beleive in Santa? ":"yes"
}
a)
list
b)
string
c)
dictionart
d)
dictionary
52.

Which of the following methods is used to add an element to the end of a list in Python?

a)

`insert()`

b)

`append()`

c)

`extend()`

d)

`add()`

53.

Apa nama data type dalam Python yang digunakan untuk menyimpan data teks?

a)

String

b)

Boolean

c)

Numeric

d)

Sequence

54.

Apa nama data type dalam Python yang digunakan untuk menyimpan data logika?

a)

String

b)

Boolean

c)

Numeric

d)

Sequence

55.

Apa yang dimaksud dengan function di Python?

a)

Kategori yang menentukan jenis, nilai, dan operasi pada data

b)

Struktur yang menentukan cara menyimpan, mengatur, dan mengakses data

c)

Fungsi yang menentukan input, output, dan proses yang dilakukan pada data

d)

Ekspresi yang menentukan kondisi, perbandingan, dan logika pada data

56.

Bagaimana cara membuat regular function di Python yang menerima dua argumen x dan y dan mengembalikan hasil penjumlahan keduanya?

a)

def (x + y): return x, y

b)

def add(x + y): return x, y

c)

def (x, y): return x + y

d)

def add(x, y): return x + y

57.

How do you remove an item from a list in Python?

a)

Using the pop() method.

b)

Using the discard() method.

c)

Using the delete() method.

d)

Using the remove() method.

58.

people = ["John", "Rob", "Bob"]

print (people[1])

what would this result be?

a)
John
b)
Rob
c)
Bob
59.

people = ["John", "Rob", "Bob"]

print (people[4])

what would this result be?

a)
John
b)
Rob
c)
Bob
d)
Error
60.
To repeat until a particular condition is true use
a)
while loop
b)
for loop
c)
if loop
d)
indentation
61.

A data type than can have one of two values: True or False

a)

boolean

b)

variable

c)

modulo

d)

interpreter

62.
In the following code, "city" is an example of a what?
a)
List
b)
Loop
c)
Variable
d)
Array
63.

What is a variable?

a)

Step by step instructions to solve a problem

b)

A location in memory that stores a value, and that value can change

c)

A set of rules

d)

A location in memory that stores a value, and that value cannot change

64.
Which of the following is NOT a sort algorithm?
a)
Bubble
b)
Merge
c)
Insertion
d)
Linear
65.
Which of the following describes a merge sort?
a)
Compares each pair and swaps
b)
List is split in two and merged together in order
c)
List is split into 2 and kept seperate
d)
None of the above
66.

What is this code an example of:


IF length of password <= 6 THEN

print(“Password is too short.”)

ELSE

print(“password is valid.”)

ENDIF

a)

Selection

b)

Iteration

c)

Print

d)

Sequence

67.

This code uses which construct?

x = 0

WHILE x < 5

print(x)

x = x + 1

END WHILE

a)

Sequence

b)

Selection

c)

Iteration

68.

What keyword indicates that it is a function and not a procedure?

a)

RETURN

b)

PRINT

c)

INT

d)

DEF

69.

Is this a function or a procedure?

a)

Function

b)

Procedure

70.
What command is this shape for?
a)
References another part of the program
b)
Data that is going in as input or coming out as output
c)
Processing something - a calculation or storing something into a variable
d)
Shows the direction of the program
71.
Tells the interpreter that the code which follows is a function
a)
const
b)
int
c)
def
d)
while
72.

Sequence is when...

a)

...instructions are executed one after another

b)

instructions are executed one after another in a series

c)

instructions are executed by the user

d)

instructions are executed one after another but not always in series

73.

Selection is when...

a)

...a program will execute instructions regardless of what the user does

b)

...a program will execute certain instructions based on the user's actions

c)

...a program will execute certain instructions based on conditions

d)

....a program will execute all instructions regardless of what the user does

74.

Selection statements include...

a)

IF, THEN, ELSE & CASE

b)

IF, ELSE, & CASE

c)

IF, THAN, ELSE & CASE

d)

IF, THEN, ELSE, ELIF & CASE

75.

In computer programming 'iteration' is used to...

a)

... loop around and around a piece of code until the correct answer is chosen

b)

...loop around a piece of code until a condition is met that activates the next part of the program

c)

...loop around and around a piece of code until a condition is met that ends the iteration

d)

...loop twice around a piece of code until a condition is met that ends the iteration

76.

Choose the conditional operator for not equal to:

a)

==

b)

=!

c)

<>

d)

!=

77.

What are the three components of any algorithm?

a)

Time Complexity, Memory Usage, Recursion

b)

Start, Middle, End

c)

Variables, Functions, Loops

d)

Input, Process, Output

78.

_____ is an algorithm that treats a list as two parts, a sorted part and an unsorted part, and repeatedly inserts the next value from the unsorted part into the correct location in the sorted part.

a)

Selection sort

b)

Insertion sort

c)

Merge sort

d)

Quick sort

79.

What is the runtime complexity of selection sort?

a)

0(NlogN)

b)

0(logN)

c)

0(N2)

d)

0(N)

80.

Which of the following lists are sorted in ascending order?

a)

[‘apple’, ‘apricot’, ‘avocados’]

b)

[‘bananas’, ‘Boysenberries’, ’blueberries’]

c)

[‘cherries’, ‘crab apples’, ‘cantaloupes’]

d)

[‘drew berries’, ‘dates’, ‘damson plum’]

81.

When you read code carefully to look for errors and fix them

a)

debug

b)

fix

c)

try again

d)

mistake

82.

Notes that explain to others what each part of your program does.

a)

code

b)

comment

c)

notes

d)

plan

83.

The rules for correct spelling, grammar, and punctuation in a programming language

a)

while true loop

b)

method

c)

syntax

d)

algorithm

84.

3)A_____ in python that is used to define numbers. 



a)

a) Integer 

b)

b) Boolean 

c)

c) Float

d)

d) String

85.

7)What data type is the object below?


L = [1, 23, 'hello', 1]



a)

a)  list 

b)

b) dictionary

c)

c) array 

d)

d) tuple

86.

18)Read the Python program below:


a = 13

print(2*a)

print(a)


When this program is run, what will be displayed on the screen?



a)

a)13 26

b)

b)Line 3 will not be executed 

c)

c)13

d)

d)26

87.

Which term describes the process of hiding the complexity of a system while exposing only the necessary parts?

a)

A) Encapsulation

b)

B) Abstraction

c)

C) Inheritance

d)

D) Polymorphism

88.

What would the next of the last node of a circular linked list return?

a)

head

b)

tail

c)

null

d)

none of the above

89.

What advantage does a linked list have over an array?

a)

A linked list can give you the data faster

b)

It is easier to use

c)

A linked list is not of a fixed size

d)

It's better

90.

Circular Linked List will be

a)

Only Singly

b)

Only Doubly

c)

Singly and Doubly

d)

None

91.

Array Comes under

a)

Linear Data Structures

b)

Non - Linear Data Structures

c)

Primitive Data Structures

d)

None of the Above

92.

A linear dynamic data structure to store data items is called

a)

Linked list

b)

Stack

c)

Tree

d)

Queue

93.

Two dimensional arrays are also known as ______________

a)

Subscripts

b)

Matrices

c)

ndarray

d)

Vectors

94.

How do you access the third element in an array named 'arr'?

a)

arr[2]

b)

arr(2)

c)

arr[3]

d)

arr.third()

95.

What method is used to add an element to the end of an array in Python?

a)

The insert() method is used to add an element to the end of an array in Python.

b)

The pop() method is used to add an element to the end of an array in Python.

c)

The remove() method is used to add an element to the end of an array in Python.

d)

The append() method is used to add an element to the end of an array in Python.

96.

What method is used to sort the elements of an array in Python?

a)

organize()

b)

sort()

c)

order()

d)

arrange()

97.

Apa perbedaan utama antara array dan list di Python?

a)

Array bersifat dinamis, list bersifat statis

b)

Array hanya dapat menyimpan satu tipe data, list lebih fleksibel

c)

Array tidak memiliki indeks, list memiliki indeks

d)

Array dapat menyimpan berbagai tipe data, list tidak bisa

98.

Apa fungsi len() pada list?

a)

Menghitung jumlah elemen dalam list

b)

Mengurutkan elemen list

c)

Menambah panjang list

d)

Mengubah ukuran list

99.

Which of these statements is true for a linear search?

a)

The algorithm only searches for 0 or 1

b)

The data must be sorted in order

c)

It is very inefficient for large data sets

d)

It is very inefficient for small data sets

100.
What would 'leaving' a queue be called?
a)
"Dequeue"
b)
"Enqueue"
c)
"Leave queue"
d)
"Delete 'system 32' folder"