Algo long quiz 2

5 0 0
                                    

There are four kinds of transversal that is commonly used in , these are Pre-order, In-order, Post-order and ____________


b.

Level-order


The height of the tree is the height of the ______ node


d.

Root

Which of the following describes stack data structure?


b.

Stack is stored in a single dimensional array.


To delete an element, get the data from the first or top node and store it in a variable


True

In computer programming, processing of subroutine calls and returns applies ____________________ data structure.

Select one:a.

Stack


Given the array name arr_category with a size of 3, what is the function to check the size of an array?


b.

size()

What is the maximum number of nodes at level 3 of the binary tree?

Select one:
b.

8


In post-order traversal, it follows the pattern: ______________

c.

"left -> right -> root"


North Luzon Express Way collects tax to all motorist passing through the toll gate. The strategy that applies when collecting tax to all vehicles in the toll gate is a real life example of ___________________________.


c.

Queue


The following statements below defines that a binary tree is a group of nodes, except for two.

I. Each node contains a value, links with at most two nodes. Its left and right child.

II. The root node with no children are called leaves, or external nodes.

III. Nodes which are not leaves are internal nodes.

IV. Nodes with the same parent are called cousins.


a.

Statement II. And IV. Only

What traversal follows the "root -> left -> right"?


d.

Pre-order

Given data elements 8 1 6 9 2 9 are inserted into a data structure in that order. An item is deleted using a basic delete operation and the deleted item is 8. The data structure is said to be a ___________.


b.

Queue


What makes the complete binary?

d.

all the levels are completely filled probably the last level wherein it can have an incomplete number of nodes.

LIFO means last-in, first-out.


True

A binary tree has 30 nodes. How many levels are there in the binary tree


d.

5

Queue is defined as a collection that keeps objects in a sequence, where data element access and deletion are restricted to the first element in the sequence.

True

The first element in a queue will be the last element out of the queue

False

What is the type of binary tree in which the values less than the root node are inserted to the left and the values that are greater than the root node are inserted to the right?


c.

Binary search tree

What is the other way to perform iterations that happens when a specific function calls itself in order to iterate?

d.

recursion

These are the operations that are commonly used on a binary tree, except for one:

I. Determine whether the binary tree is empty.

II. Search the binary tree for a particular item.

III. Traverse the binary tree.

IV. Delete the binary tree.

a.

Statement IV only

In queue data structure, insertion will be done ____________________.

d.

at the rear element of the sequence

The balancing of parenthesis, brackets and braces of computer program is an example of ___________________ data structure.

c.

Stack


Which of the following describes the maximum depth of a tree?

b.

The maximum depth of a tree is equal to the height of the tree.


What operations does binary tree require to pass through all nodes?


a.

All of the choices


How many are the main basic operations of a stack?

d.

2

Which of the following describes the situation when an attempt to insert into a stack that is already full?


c.

Stack will cause an overflow


The "Undo" mechanism in Microsoft Office Application Software is an example of a ________________ data structure.


c.

Stack


Stack can be implemented using

d.

Either sequential or linked list implementation

You've reached the end of published parts.

⏰ Last updated: Sep 16, 2024 ⏰

Add this story to your Library to get notified about new parts!

Discrete MathematicsWhere stories live. Discover now