NEW
Font size
WorksheetsData Structure UTS
Total questions: 60
Worksheet time: 53mins
A series of values stored in memory is called ___
an array
a tree
a matrix
a struct
Almost all programming languages start arrays at ___
index 0
index 1
index 2
the null character
In almost all programming languages, what kind of bracketing is used to denote array access?
round brackets
square brackets
curly braces
quotation marks
A data type that can be used to group items of possibly different types into a single type is called ___
a root
a struct
a tree
a pointer
A type of struct that stores a variable, like a number, and also a pointer is called ___
a nodule
a radix
a node
a root
A flexible data structure that can store many nodes is called ___
a tree
a linked list
a pointer
a queue
Complex data structures built on top of linked lists, that use First-In First-Out behaviour, are called ___
vectors
strings
queues
stacks
When linked lists are used as stacks, what kind of behaviour is implemented?
First-In First-Out, or FIFO
First-In Last-Out, or FILO
Last-In Last-Out, or LILO
Last-In First-Out, or LIFO
In a tree data structure, the top most node is called ___
the peak
the apex
the crown
the root
In a tree data structure, any nodes that hang from other nodes are called ___
branched nodes
leaf nodes
children nodes
daughter nodes
In a tree data structure, any nodes that have no children (where the tree ends) are called ___
boundary nodes
leaf nodes
orphan nodes
terminal nodes
Linked List is dynamic in nature
Which data structure would be ideal for managing high priority alerts?
Which of the following is NOT a type of Linked List?
Singly Linked List
Doubly Linked List
Array Linked List
Circular Linked List
Pointer is __________ data type
derived
primary
user defined
none of above
_________ operation removes the element from the top of the stack.
push
pop
update
none of the above
_________ operation adds an element to the top of the stack.
pop
push
peep
all of the above
The postfix form of the expression (A+ B)*(C*D - E)*F / G is
AB+ CD*E - FG /**
AB + CD* E - F **G /
AB + CD* E - *F *G /
AB + CDE * - * F *G /
What is the postfix form of the following prefix expression -A/B*C/DE
ABCDE/*/-
A-BCDE/*/-
ABC/ED*/-
A-BCDE/*/
The postfix form of A*B+C/D is
*AB/CD+
AB*CD/+
A*BC+/D
ABCD+/*
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?
5,4
3,4
4,7
4,5
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?
7
4
3
14
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?
7
4
3
14
What is the value of the ROOT node in this Tree?
35
24
42
20
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?
3
4
5
6
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?
ABCD
DCBA
DCAB
ABDC
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
1
3
2
4
What do you call the position of John in the image?
Topmost
Root
Child
Parent
What do you call Steve and Rohan?
Root
Parent
Descendant
Leaf
Emma, Tom, and Bill are considered ______ of Rohan.
Descendants
Childs
Successors
Parent
Any node is the path from the root to the node is called
Ancestor node
Internal node
Successor node
None of the above
Explain the process of inserting a node at the beginning of a linked list.
Create a new node, set its next pointer to a random node, update head to new node.
Create a new node, set its next pointer to null, update head to new node.
Create a new node, set its next pointer to current head, update head to new node.
Create a new node, set its next pointer to the previous node, update head to new node.
What are some common operations that can be performed on a linked list?
insertion, deletion, traversal, searching, updating nodes
reversing
merging
sorting
Provide an example of an application where a linked list is used.
Fitness tracker
Music playlist
Calendar app
Weather forecast app
How is memory managed in a linked list?
Memory is managed by using a fixed-size array for all nodes
Memory is managed by storing all nodes in a single block of memory
Memory is managed by allocating memory only once for the entire linked list
Memory is managed dynamically by allocating and deallocating memory for each node as needed.
Explain the process of deleting a node from a linked list.
The process involves finding the previous node, updating its next pointer, and freeing the memory of the node to be deleted.
Deleting a node requires updating the previous node's data
The process involves reversing the linked list
To delete a node, simply disconnect it from the list
What are the advantages of using a linked list over an array?
Linked lists provide dynamic size, easy insertion and deletion, no need for contiguous memory allocation, and efficient memory usage for small data sizes.
Linked lists have fixed size
Linked lists require contiguous memory allocation
Linked lists are slower than arrays
A ____ is collection of data and links
array
queue
stack
node
Linked list has the form like
Chain
Wagons
Bracelet
Necklace
How to insert a new node in the beginning of the linked list
Head -> new node, new node -> previous node
Previous node -> new node, new node -> next node
Previous tail -> new node, new node -> null
Head -> previous node, previous node -> new node
The situation when in a linked list Head==NULL
is
Full
Empty
Half full
saturated
In the above image what will be printed when Head->next->data?
83
9
27
Error
What is value in the head -> next -> next below?
12
4600
1600
88
What is the operation of the below statements?
Create a new node for a linked list
Insert a new node to the front of a linked list
Delete a new node from a linked list
Insert a new node to the end of the linked list
Which the following circular linked list
How to delete node B?
head->next=TempPtr; free(TemPtr);
free(TemPtr); head->next=TempPtr->next;
head->next=TempPtr->next;free(TemPtr)r;
free(head); head->next= TempPtr->next
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
1
2
3
4
How many null pointers exists in a circular linked list?
0
1
2
3
circular linked list
linked list
doubly circular linked list
doubly linked list
What is the status after adding 10
Val1 menunjukan tail atau ekor dari single linked list.
Benar
Salah
Alamat Node terakhir dalam Single Linked List tidak selalu berisi NULL.
Benar
Salah
Pada doubly linked list penghapusan node di belakang tidak perlu menggunakan variabel bantu karena
Keadaan node sedang ditunjuk oleh pointer
sebelum data terdepan dihapus
Harus menunjuk ke node berikutnya agar list tidak putus
ada pointer prev dari tail
Keuntungan apa yang dimiliki linked list dibandingkan array?
Linked list dapat memberikan data lebih cepat
Linked list tidak berukuran tetap
Lebih mudah digunakan
Lebih baik
Single Linked List memiliki field pointer sebanyak?
Hanya satu dan dua arah
Hanya satu dan satu arah
Hanya dua dan dua arah
Hanya dua dan satu arah
Tidak memiliki field pointer
