wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Data Structure UTS

Total questions: 60

Worksheet time: 53mins

Name
Class
Date
1.

A series of values stored in memory is called ___

a)

an array

b)

a tree

c)

a matrix

d)

a struct

2.

Almost all programming languages start arrays at ___

a)

index 0

b)

index 1

c)

index 2

d)

the null character

3.

In almost all programming languages, what kind of bracketing is used to denote array access?

a)

round brackets

b)

square brackets

c)

curly braces

d)

quotation marks

4.

A data type that can be used to group items of possibly different types into a single type is called ___

a)

a root

b)

a struct

c)

a tree

d)

a pointer

5.

A type of struct that stores a variable, like a number, and also a pointer is called ___

a)

a nodule

b)

a radix

c)

a node

d)

a root

6.

A flexible data structure that can store many nodes is called ___

a)

a tree

b)

a linked list

c)

a pointer

d)

a queue

7.

Complex data structures built on top of linked lists, that use First-In First-Out behaviour, are called ___

a)

vectors

b)

strings

c)

queues

d)

stacks

8.

When linked lists are used as stacks, what kind of behaviour is implemented?

a)

First-In First-Out, or FIFO

b)

First-In Last-Out, or FILO

c)

Last-In Last-Out, or LILO

d)

Last-In First-Out, or LIFO

9.

In a tree data structure, the top most node is called ___

a)

the peak

b)

the apex

c)

the crown

d)

the root

10.

In a tree data structure, any nodes that hang from other nodes are called ___

a)

branched nodes

b)

leaf nodes

c)

children nodes

d)

daughter nodes

11.

In a tree data structure, any nodes that have no children (where the tree ends) are called ___

a)

boundary nodes

b)

leaf nodes

c)

orphan nodes

d)

terminal nodes

12.
What data structure uses the LIFO principle?
a)
Array
b)
Queue
c)
Stack
d)
Linked List
13.
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
14.
What principle does a Queue follow?
a)
Last In First Out (LIFO)
b)
Last In Last Out (LILO)
c)
First In Last Out (FILO)
d)
First In First Out (FIFO)
15.
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
16.

Which data structure would be ideal for managing high priority alerts?

a)
Stack
b)
Priority Queue
c)
Array
d)
Linked List
17.

Which of the following is NOT a type of Linked List?

a)

Singly Linked List

b)

Doubly Linked List

c)

Array Linked List

d)

Circular Linked List

18.

Pointer is __________ data type

a)

derived

b)

primary

c)

user defined

d)

none of above

19.

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

a)

push

b)

pop

c)

update

d)

none of the above

20.

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

a)

pop

b)

push

c)

peep

d)

all of the above

21.

The postfix form of the expression (A+ B)*(C*D - E)*F / G is

a)

AB+ CD*E - FG /**

b)

AB + CD* E - F **G /

c)

AB + CD* E - *F *G /

d)

AB + CDE * - * F *G /

22.

What is the postfix form of the following prefix expression -A/B*C/DE

a)

ABCDE/*/-

b)

A-BCDE/*/-

c)

ABC/ED*/-

d)

A-BCDE/*/

23.

The postfix form of A*B+C/D is

a)

*AB/CD+

b)

AB*CD/+

c)

A*BC+/D

d)

ABCD+/*

24.

Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.


Based on the diagram 2, what is the final value for variable array?

a)

5,4

b)

3,4

c)

4,7

d)

4,5

25.

Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.


Based on the diagram 2, what is the final value for variable *p?

a)

7

b)

4

c)

3

d)

14

26.

Considered that Diagram 2 has integer data type m, n, z, *p and array with the size of 3. Variables m and n has values 4 and 3 accordingly.


Based on the diagram 2, what is the final value for variable z?

a)

7

b)

4

c)

3

d)

14

27.
A tree is composed of ____ connected by edges or lines.
a)
Fruit 
b)
Leaf Node
c)
Root Node
d)
Nodes
28.

What is the value of the ROOT node in this Tree?

a)

35

b)

24

c)

42

d)

20

29.
In this tree, where would the new value "7" be placed?
a)
On the left "leaf" of "4"
b)
On the right "leaf" of "6"
c)
On the left "leaf" of "15"
d)
Over the top of the current number "5"
30.

Given a sequence of number below:

50,60,40,70,45,55,30,80,65,35,25,75,85


When creating a binary search tree, what is the height of the tree?

a)

3

b)

4

c)

5

d)

6

31.

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

a)

ABCD

b)

DCBA

c)

DCAB

d)

ABDC

32.

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, the no of element present on stack are

a)

1

b)

3

c)

2

d)

4

33.

What do you call the position of John in the image?

a)

Topmost

b)

Root

c)

Child

d)

Parent

34.

What do you call Steve and Rohan?

a)

Root

b)

Parent

c)

Descendant

d)

Leaf

35.

Emma, Tom, and Bill are considered ______ of Rohan.

a)

Descendants

b)

Childs

c)

Successors

d)

Parent

36.

Any node is the path from the root to the node is called

a)

Ancestor node

b)

Internal node

c)

Successor node

d)

None of the above

37.

Explain the process of inserting a node at the beginning of a linked list.

a)

Create a new node, set its next pointer to a random node, update head to new node.

b)

Create a new node, set its next pointer to null, update head to new node.

c)

Create a new node, set its next pointer to current head, update head to new node.

d)

Create a new node, set its next pointer to the previous node, update head to new node.

38.

What are some common operations that can be performed on a linked list?

a)

insertion, deletion, traversal, searching, updating nodes

b)

reversing

c)

merging

d)

sorting

39.

Provide an example of an application where a linked list is used.

a)

Fitness tracker

b)

Music playlist

c)

Calendar app

d)

Weather forecast app

40.

How is memory managed in a linked list?

a)

Memory is managed by using a fixed-size array for all nodes

b)

Memory is managed by storing all nodes in a single block of memory

c)

Memory is managed by allocating memory only once for the entire linked list

d)

Memory is managed dynamically by allocating and deallocating memory for each node as needed.

41.

Explain the process of deleting a node from a linked list.

a)

The process involves finding the previous node, updating its next pointer, and freeing the memory of the node to be deleted.

b)

Deleting a node requires updating the previous node's data

c)

The process involves reversing the linked list

d)

To delete a node, simply disconnect it from the list

42.

What are the advantages of using a linked list over an array?

a)

Linked lists provide dynamic size, easy insertion and deletion, no need for contiguous memory allocation, and efficient memory usage for small data sizes.

b)

Linked lists have fixed size

c)

Linked lists require contiguous memory allocation

d)

Linked lists are slower than arrays

43.

A ____ is collection of data and links

a)

array

b)

queue

c)

stack

d)

node

44.

Linked list has the form like

a)

Chain

b)

Wagons

c)

Bracelet

d)

Necklace

45.

How to insert a new node in the beginning of the linked list

a)

Head -> new node, new node -> previous node

b)

Previous node -> new node, new node -> next node

c)

Previous tail -> new node, new node -> null

d)

Head ->  previous node, previous node -> new node

46.

The situation when in a linked list Head==NULL

is

a)

Full

b)

Empty

c)

Half full

d)

saturated

47.

In the above image what will be printed when Head->next->data?

a)

83

b)

9

c)

27

d)

Error

48.

What is value in the head -> next -> next below?

a)

12

b)

4600

c)

1600

d)

88

49.

What is the operation of the below statements?

a)

Create a new node for a linked list

b)

Insert a new node to the front of a linked list

c)

Delete a new node from a linked list

d)

Insert a new node to the end of the linked list

50.

Which the following circular linked list

a)
b)
c)
51.

How to delete node B?

a)

head->next=TempPtr; free(TemPtr);

b)

free(TemPtr); head->next=TempPtr->next;

c)

head->next=TempPtr->next;free(TemPtr)r;

d)

free(head); head->next= TempPtr->next

52.

How many times should


“temp =temp->next” be executed in the image to get the value of "Null" when the initial value of temp is temp=head

a)

1

b)

2

c)

3

d)

4

53.

How many null pointers exists in a circular linked list?

a)

0

b)

1

c)

2

d)

3

54.
a)

circular linked list

b)

linked list

c)

doubly circular linked list

d)

doubly linked list

55.

What is the status after adding 10

a)
b)
c)
d)
56.

Val1 menunjukan tail atau ekor dari single linked list.

a)

Benar

b)

Salah

57.

Alamat Node terakhir dalam Single Linked List tidak selalu berisi NULL.

a)

Benar

b)

Salah

58.

Pada doubly linked list penghapusan node di belakang tidak perlu menggunakan variabel bantu karena

a)

Keadaan node sedang ditunjuk oleh pointer

b)

sebelum data terdepan dihapus

c)

Harus menunjuk ke node berikutnya agar list tidak putus

d)

ada pointer prev dari tail

59.

Keuntungan apa yang dimiliki linked list dibandingkan array?

a)

Linked list dapat memberikan data lebih cepat

b)

Linked list tidak berukuran tetap

c)

Lebih mudah digunakan

d)

Lebih baik

60.

Single Linked List memiliki field pointer sebanyak?

a)

Hanya satu dan dua arah

b)

Hanya satu dan satu arah

c)

Hanya dua dan dua arah

d)

Hanya dua dan satu arah

e)

Tidak memiliki field pointer