0% found this document useful (0 votes)
68 views

Test - Learning Outcome 1 - PGR206-1 23H Data Structures and Algorithms

This document contains a 20 question multiple choice quiz about data structures and algorithms. The quiz has a 30 minute time limit and students need to answer at least 40% of the questions correctly to pass. The quiz contains questions about arrays, stacks, queues, and their properties like FIFO, LIFO. The attempt history shows that the student answered 19 out of 20 questions correctly within 27 minutes on their first attempt.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views

Test - Learning Outcome 1 - PGR206-1 23H Data Structures and Algorithms

This document contains a 20 question multiple choice quiz about data structures and algorithms. The quiz has a 30 minute time limit and students need to answer at least 40% of the questions correctly to pass. The quiz contains questions about arrays, stacks, queues, and their properties like FIFO, LIFO. The attempt history shows that the student answered 19 out of 20 questions correctly within 27 minutes on their first attempt.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Test: Learning Outcome 1


Due No due date Points 20 Questions 20
Available Sep 13 at 3:20pm - Sep 13 at 3:50pm 30 minutes Time Limit 30 Minutes

Instructions
Dear Students,

You will have 20 multiple-choice questions and 30 minutes to complete the test! This test will be included
in approved/not approved. To pass the test you will need at least 40% correct answers.

Best Wishes!

Have a happy learning!

Attempt History
Attempt Time Score
LATEST Attempt 1 27 minutes 19 out of 20

 Correct answers will be available on Sep 13 at 4pm.

Score for this quiz: 19 out of 20


Submitted Sep 13 at 3:47pm
This attempt took 27 minutes.

Question 1 1 / 1 pts

How can we describe an array in the best possible way?

The Array shows a hierarchical structure.

The Array is not a data structure

https://kristiania.instructure.com/courses/11154/quizzes/19973 1/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Arrays are immutable.

Container that stores the elements of similar types

The answer is "Container that stores the elements of similar types"


because the array stores the elements in a contiguous block of
memory of similar types. Therefore, we can say that array is a
container that stores elements of similar types.

Question 2 1 / 1 pts

Which of the following is the disadvantage of the array?

Stack and Queue data structures can be implemented through an array

Wastage of memory if the elements inserted in an array are lesser than the
allocated size

The answer is "Wastage of memory if the elements inserted in an


array are lesser than the allocated size". For example, if we have an
array of size 10 elements and we have inserted only 5 elements in an
array, then there is a wastage of 5 memory blocks which cannot be
utilised by another variable.

Index of the first element in an array can be negative

Elements can be accessed sequentially.

Question 3 1 / 1 pts

https://kristiania.instructure.com/courses/11154/quizzes/19973 2/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Which one of the following is the process of inserting an element in the


stack?

Add

Push

In stack, the process of inserting an element is known as a push


operation.

None of the mentioned

Insert

Question 4 1 / 1 pts

When the user tries to delete the element from the empty stack then the
condition is said to be a ____

None of the mentioned

Garbage collection

Underflow

Underflow is a condition that occurs when user tries to implement the


pop operation in the empty stack.

Overflow

Question 5 1 / 1 pts

https://kristiania.instructure.com/courses/11154/quizzes/19973 3/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

If the size of the stack is 10 and we try to add the 11th element in the
stack then the condition is known as___

Garbage collection

Underflow

None of the mentioned

Overflow

Because the stack is full with its 10 elements, inserting one more
element in a stack will lead to the stack overflow.

Question 6 1 / 1 pts

Which of the following is not the correct statement for a stack data
structure?

Stack follows FIFO

Stack does not follow FIFO. It follows LIFO.

Elements are stored in a sequential manner

Arrays can be used to implement the stack

Top of the stack contains the last inserted element

Question 7 1 / 1 pts

https://kristiania.instructure.com/courses/11154/quizzes/19973 4/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

If the elements '1', '2', '3' and '4' are added in a stack, so what would be
the order for the removal?

2134

None of the mention

1234

4321

because stack follows LIFO, which means that the element inserted
at the last will be removed first.

Question 8 1 / 1 pts

If the elements '1', '2', '3' and '4' are inserted in a queue, what would be
order for the removal?

1234

The queue follows the FIFO principle in which the element inserted
first will be removed first.

4321

None of the mentioned

3241

Question 9 1 / 1 pts

https://kristiania.instructure.com/courses/11154/quizzes/19973 5/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Which one of the following is not the type of the Queue?

Linear Queue

Single ended Queue

Queue has two ends in which one end is used for the insertion and
another end is used for the deletion. Therefore, it is not possible for
the Queue to have a single ended queue.

Circular Queue

Double ended Queue

Question 10 1 / 1 pts

Which one of the following is the overflow condition if linear queue is


implemented using an array with a size MAX_SIZE?

rear = front+1

rear=MAX_SIZE -1

As the size of the array is MAX_SIZE, so we can insert the elements


till MAX_SIZE-1. If we try to insert the elements of size MAX_SIZE or
more than MAX_SIZE in a queue, then it leads to the overflow
condition.

rear = front

rear = MAX_SIZE

https://kristiania.instructure.com/courses/11154/quizzes/19973 6/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Question 11 1 / 1 pts

Which of the following that determines the need for the Circular Queue?

None of the mentioned

Access the Queue using priority

Follows the FIFO principle

Avoid wastage of memory

In a linear queue, there are chances of wastage of memory because


if the rear is pointing to the last element whereas the front is pointing
to the element other than the first element; it means that spaces
allocated before the front are free, but it cannot be reused as rear
cannot be incremented. In contrast, the last element is connected to
the first element in a circular queue; if initial spaces are vacant, then
rear can be incremented by using the statement (rear+1) mod max
where max is the size of the array. Therefore, we conclude that the
circular queue avoids wastage of memory.

Question 12 1 / 1 pts

Which of the following statement is not true about the doubly linked list?

We can traverse in both the directions.

Implementation of doubly linked list is easier than the singly linked list

The implementation of a doubly linked list is complex as compared to


a singly linked list, as it needs to store the addresses of the two
nodes, i.e., the previous and the next node. If we insert or delete the
node from the doubly linked list, then it needs to adjust two pointers,
the previous and the next pointer.

https://kristiania.instructure.com/courses/11154/quizzes/19973 7/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

It stores the addresses of the next and the previous node

It requires extra space

Question 13 1 / 1 pts

What is the output of the following code snippet?

void solve()

stack<int> s;

s.push(1);

s.push(2);

s.push(3);

for(int i = 1; i <= 3; i++)

System.out.println(s.top());

s.pop();

321

Stack follows a last in first out methodology, so the elements are


popped out in reverse order.

123

https://kristiania.instructure.com/courses/11154/quizzes/19973 8/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Question 14 1 / 1 pts

Other name for directed graph is .........

Digraph

Direct graph

Dir-graph

Directed graph

Question 15 1 / 1 pts

In tree data structures, nodes with no successor are called .....

Last nodes

Terminal/External nodes

End nodes

Final nodes

Question 16 1 / 1 pts

The five items:A,B,C,D, and E, are pushed in a stack, one after the other,
starting from A.The stack is popped four times, and each element is
https://kristiania.instructure.com/courses/11154/quizzes/19973 9/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

inserted in a queue.Then two elements are deleted from the queue and
pushed back on the stack.Now one item is popped from the stack.
The popped item is

In queue elements are deleted from front (FIFO) and in stacks


elements are popped from top (LIFO)

Question 17 1 / 1 pts

Following sequence of operations is performed on a stack push(1),


push(2), pop, push(1), push(2), pop, pop, pop, push(2), pop.The
sequence of poped out values are

2,1,2,2,1

2,1,2,2,2

2,2,1,1,2

2,2,1,2,2

https://kristiania.instructure.com/courses/11154/quizzes/19973 10/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Question 18 1 / 1 pts

The initial configuration of a queue is a, b, c, d, ('a' is in the front end). To


get the configuration d, c, b, a, one needs a minimum of

3 deletion and 2 additions

3 deletions and 4 additions

3 deletions and 3 additions

2 deletions and 3 additions

Question 19 1 / 1 pts

The children of a same parent node are called as:

non-leaf node

adjacent node

Sibblings

leaf node

Incorrect
Question 20 0 / 1 pts

The elements of a linked list are stored

In an array

In contiguous memory locations


https://kristiania.instructure.com/courses/11154/quizzes/19973 11/12
9/13/23, 3:48 PM Test: Learning Outcome 1: PGR206-1 23H Data Structures and Algorithms

Anywhere the computer has space for them

In a structure

Quiz Score: 19 out of 20

https://kristiania.instructure.com/courses/11154/quizzes/19973 12/12

You might also like