m2 Flashcards

1
Q

How do you remove data from a singly linked list?

You can only remove the data in the middle of the list.

You can only remove the last data from the list.

You can only remove the first data from the list.

You can remove the first data, last data, or any data in the list by adjusting the pointers of the respective nodes.

A

You can remove the first data, last data, or any data in the list by adjusting the pointers of the respective nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the operations used in linked list structures?

Traversing the list, inserting data, removing data, and retrieving data.

Sorting the list, merging lists, splitting the list, and reversing the list.

Adding elements to the list, updating elements in the list, and searching for elements in the list.

Finding the maximum element, finding the minimum element, and finding the length of the list.

A

Traversing the list, inserting data, removing data, and retrieving data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you retrieve data from a singly linked list?

Sort the list and compare the data field of each node to the value being searched for.

Reverse the list and compare the data field of each node to the value being searched for.

Skip every other node and compare the data field of each node to the value being searched for.

Traverse the list and compare the data field of each node to the value being searched for.

A

Traverse the list and compare the data field of each node to the value being searched for.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you insert data into a singly linked list?

Always insert the new data in between the first and second nodes of the list.

Always insert the new data at the beginning of the list.

Always insert the new data at the end of the list.

If the list is empty, create the first node. Otherwise, find the right position to insert the new data (beginning, end, or in between nodes)`

A

If the list is empty, create the first node. Otherwise, find the right position to insert the new data (beginning, end, or in between nodes).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the disadvantages of using a circular linked list?

It requires more complex implementation of operations on linked list structures.

It has limited functionality compared to other linked list structures.

It occupies more memory than other linked list structures.

It has slower traversal compared to other linked list structures

A

It requires more complex implementation of operations on linked list structures.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you traverse a singly linked list?

Starting from the head, check if the next pointer is null. If not, move to the next node until the end of the list is reached.

Starting from a random position, check if the previous or next pointer is null. If not, move to the previous or next node depending on the condition.

Starting from the tail, check if the previous pointer is null. If not, move to the previous node until the start of the list is reached.

Starting from the middle, check if the previous or next pointer is null. If not, move to the previous or next node depending on the condition.

A

Starting from the head, check if the next pointer is null. If not, move to the next node until the end of the list is reached.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you traverse and retrieve data from a circular linked list?

Skip every other node and compare the data field of each node to the value being searched for.

Reverse the list and compare the data field of each node to the value being searched for.

Sort the list and compare the data field of each node to the value being searched for.

Perform similar operations as with a singly linked list, but ensure the termination condition for traversal considers the circular nature of the list.

A

Perform similar operations as with a singly linked list, but ensure the termination condition for traversal considers the circular nature of the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What makes a doubly linked list different from a singly linked list?

A doubly linked list has a circular structure.

A doubly linked list allows bidirectional traversal.

A doubly linked list has three fields: data, previous, and next pointer.

A doubly linked list contains a reference to both the previous and next elements in the list.

A

A doubly linked list contains a reference to both the previous and next elements in the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a singly linked list?

A data structure that consists of two fields: data and previous pointer.

A data structure that consists of a sequence of elements, each containing a reference to the previous element.

A data structure that consists of a sequence of elements, each containing a reference to the next element.

A data structure that contains a reference to both the previous and next elements.

A

A data structure that consists of a sequence of elements, each containing a reference to the next element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the advantages of using a circular linked list?

It uses less memory than other linked list structures.

It provides easy manipulation of the pointers and efficient searching.

It allows for faster insertion and deletion operations compared to other linked list structures.

It guarantees constant time complexity for all operations.

A

It provides easy manipulation of the pointers and efficient searching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the purpose of converting an infix expression to postfix notation using a stack?

To reverse the order of the operands and operators

To convert numbers from decimal to binary notation

To evaluate arithmetic expressions and handle operator precedence

To group the operands and operators in parentheses

A

To evaluate arithmetic expressions and handle operator precedence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are some of the applications that can be solved using Stack data structure?

Expression Evaluation, Function Call Stack, Undo Operations, Backtracking, Memory Management

Sorting Algorithms, Binary Search, Linked Lists

Looping, Conditional Statements, File Handling

Networking, Database Management, Artificial Intelligence

A

Expression Evaluation, Function Call Stack, Undo Operations, Backtracking, Memory Management

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which operations can be used in the implementation of Stack data structure?

Append and Prepend

Push and Pop

Insert and Delete

Sort and Search

A

Push and Pop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In a Stack data structure, where are elements inserted and removed?

Middle of the stack

Random positions in the stack

Bottom of the stack

Top of the stack

A

Top of the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which notation places the operator before the operands in an arithmetic expression?

Postfix notation

Polish notation

Infix notation

Prefix notation

A

Prefix notation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the principle behind Stack data structure?

Last-in-First-Out (LIFO)

Random

First-in-First-Out (FIFO)

Priority-based

A

Last-in-First-Out (LIFO)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the application of Stacks in memory management?

Managing activation records during program execution

Displaying graphics on computer screens

Storing data on hard disks

Accessing data from databases

A

Managing activation records during program execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the term used for inserting elements into a stack?

Insert operation

Append operation

Push operation

Add operation

A

Push operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which data structure can be used to implement a Stack?

Arrays and Linked Lists

Queues and Graphs

Hash Tables and Trees

Sets and Matrices

A

Arrays and Linked Lists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the term used for deleting elements from a stack?

Remove operation

Extract operation

Pop operation

Delete operation

A

Pop operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the function of the IsNull() operation in the Queue data structure?

Returns the size of the Queue

Evaluates if the queue is empty

Retrieves the element from the front of the Queue without removing it

Checks if the Queue is full or not

A

Evaluates if the queue is empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which operation is used to store elements in the Queue?

Size

Peek

Dequeue

Enqueue

A

Enqueue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which operations can be used in the implementation of the Queue data structure?

Push and Pop

Enqueue and Dequeue

Sort and Search

Insert and Delete

A

Enqueue and Dequeue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the function of the Peek() operation in the Queue data structure?

Get the element from the front of the Queue without removing it

Enqueue the element into the Queue

Dequeue the element from the Queue

Returns the size of the Queue

A

Get the element from the front of the Queue without removing it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the function of the Size() operation in the Queue data structure?

Retrieves the element from the front of the Queue without removing it

Inserts the element into the Queue

Checks if the Queue is empty or not

Returns the size of the Queue

A

Returns the size of the Queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the function of the IsFull() operation in the Queue data structure?

Checks if the Queue is full or not

Checks if the Queue is empty or not

Returns the size of the Queue

Retrieves the element from the front of the Queue without removing it

A

Checks if the Queue is full or not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Which operation is used to remove elements from the Queue?

Size

Enqueue

Peek

Dequeue

A

Dequeue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is the principle behind the Queue data structure?

Random access

First In First Out (FIFO)

Last In First Out (LIFO)

Stack

A

First In First Out (FIFO)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What are some applications that can be solved using the Queue data structure?

Sorting and Searching

Job scheduling and Handling resource sharing

Hashing and String Matching

Graph Traversal and Shortest Path Finding

A

Job scheduling and Handling resource sharing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are some of the variations of the Queue data structure?

Circular Queue and Priority Queue

Binary Tree and Heap

Graph and Hash Table

Stack and Linked List

A

Circular Queue and Priority Queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is a heap tree?

A binary tree with only leaf nodes

A binary tree with no nodes

A complete binary tree where the key at the root node is either the greatest (Max-Heap) or the smallest (Min-Heap) among all its children

A binary tree with only root nodes

A

A complete binary tree where the key at the root node is either the greatest (Max-Heap) or the smallest (Min-Heap) among all its children

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is the depth of a tree?

The highest level of the tree

The number of leaf nodes in the tree

The number of edges in the tree

The number of nodes in the tree

A

The highest level of the tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What is a tree data structure?

A finite collection of data arranged in a hierarchical fashion

A linear collection of data arranged in a hierarchical fashion

A random collection of data arranged in a hierarchical fashion

An infinite collection of data arranged in a hierarchical fashion

A

A finite collection of data arranged in a hierarchical fashion

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is a subtree?

A tree with only leaf nodes

A tree with only root nodes

A complete tree within the main tree

A tree with no nodes

A

A complete tree within the main tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is the degree of a node?

The value of the node

The parent of the node

The level of the node

The number of child nodes

A

The number of child nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What is a leaf node?

A node with no child nodes

A node with a value of 0

A node with multiple child nodes

There is no such thing as a leaf node

A

A node with no child nodes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

What is a binary search tree (BST)?

A binary tree with no sub-trees

A binary tree with only one node

An ordered binary tree where elements in the left sub-tree are less than the root, and elements in the right sub-tree are greater than or equal to the root

A binary tree with no order

A

An ordered binary tree where elements in the left sub-tree are less than the root, and elements in the right sub-tree are greater than or equal to the root

38
Q

What is the root node of a tree?

There is no root node

The middle node

The topmost node

The bottommost node

A

The topmost node

39
Q

What is a binary tree?

A tree with only one node

A tree where each node can have at most 2 children

A tree with no children

A tree with unlimited children

A

A tree where each node can have at most 2 children

40
Q

What is an AVL tree?

A binary search tree with no balance factor

A binary search tree with infinite nodes

A binary search tree with no heights assigned

A height-balanced binary search tree where each node is associated with a balance factor that equals the height of its left sub-tree minus the height of its right sub-tree

A

A height-balanced binary search tree where each node is associated with a balance factor that equals the height of its left sub-tree minus the height of its right sub-tree

41
Q

What is a skewed binary tree?

A binary tree in which the height is the maximum number of nodes

A binary tree in which all nodes have only one child

A binary tree in which the height is always equal to the number of nodes

A binary tree in which the height is the maximum number of branches plus 1

A

A binary tree in which the height is the maximum number of branches plus 1

42
Q

What is a binary tree?

A tree in which the left subtree always has smaller values

A tree in which every node has exactly two children

A tree in which the right subtree always has larger values

A tree in which no node can have more than two subtrees

A

A tree in which no node can have more than two subtrees

43
Q

What is an almost complete binary tree?

In the last level, the nodes will be as far left as possible and all other levels have maximum nodes

A binary tree in which nodes are evenly distributed across all levels

A binary tree in which the height is always equal to the number of nodes

A binary tree in which all nodes have two children

A

In the last level, the nodes will be as far left as possible and all other levels have maximum nodes

44
Q

What does In-order traversal mean?

Traverse the right subtree first, then the root, and finally the left subtree

Traverse the root first, then the right subtree, and finally the left subtree

Traverse the left subtree first, then the root, and finally the right subtree

Traverse the root first, then the left subtree, and finally the right subtree

A

Traverse the left subtree first, then the root, and finally the right subtree

45
Q

What does Pre-order traversal mean?

Traverse the right subtree, then left subtree, and finally root

Traverse the left subtree, then right subtree, and finally root

Traverse the right subtree, then root, and finally the left subtree

Traverse the root first, then left subtree, and finally right subtree

A

Traverse the root first, then left subtree, and finally right subtree

46
Q

What is a strictly binary tree?

The degree of any node in the binary tree will be either 0 or 2

The degree of any node in the binary tree will be either 1 or 3

The degree of any node in the binary tree will be either 2 or 3

The degree of any node in the binary tree will be either 1 or 2

A

The degree of any node in the binary tree will be either 0 or 2

47
Q

What is a complete binary tree?

A binary tree that contains exactly 2^d nodes at each level between level 0 and d

A binary tree in which the height is the maximum number of nodes

A binary tree in which the height is the maximum number of levels

A binary tree in which all nodes have exactly one child

A

A binary tree that contains exactly 2^d nodes at each level between level 0 and d

48
Q

What are the characteristics of a binary tree data structure?

A node can only have a right subtree

A node can only have a left subtree

A node always has exactly two subtrees

A node can have zero, one, or two subtrees

A

A node can have zero, one, or two subtrees

49
Q

What does Post-order traversal mean?

Traverse the root first, then the right subtree, and finally the left subtree

Traverse the right subtree first, then the left subtree, and finally the root

Traverse the root first, then the left subtree, and finally the right subtree

Traverse the left subtree first, then the right subtree, and finally the root

A

Traverse the left subtree first, then the right subtree, and finally the root

50
Q

How do we traverse a binary tree?

Pre-order, In-order, Post-order

Only In-order traversal

Only Post-order traversal

Only Pre-order traversal

A

Pre-order, In-order, Post-order

51
Q

What is the disadvantage of binary search?

Requires additional memory for storing and manipulating the tree structure

Not suitable for large datasets

Requires the array to be sorted and requires elements to be comparable

Slow searching process in comparison to arrays and linked lists

A

Requires the array to be sorted and requires elements to be comparable

52
Q

How is a node searched in a binary search tree?

The search is performed by traversing the tree in breadth-first order

Starting from the root, the key value is compared with the node’s value and the search continues in the left subtree if it’s less or in the right subtree if it’s greater

Only the nodes in the lower levels of the tree are considered for search

Starting from any leaf node, the key value is compared with the node’s value and the search continues until the root is reached

A

Starting from the root, the key value is compared with the node’s value and the search continues in the left subtree if it’s less or in the right subtree if it’s greater

53
Q

What are the characteristics of a binary search tree?

The values in the left subtree are greater than the root, and the values in the right subtree are less than the root

The values in the left subtree are less than the root, and the values in the right subtree are greater than the root

The tree has a balanced structure with equal number of nodes in each level

The tree has a height of log(n), where n is the number of nodes

A

The values in the left subtree are less than the root, and the values in the right subtree are greater than the root

54
Q

What are the operations that can be performed on a binary search tree?

Finding the median of the elements, computing the sum of all elements

Balancing the tree, merging two trees into one

Sorting the tree in ascending order, finding the height of the tree

Inserting a node, searching for a node, deleting a node, traversing the tree

A

Inserting a node, searching for a node, deleting a node, traversing the tree

55
Q

What are some applications of binary search trees?

Sorting elements in descending order

Performing arithmetic operations on large numbers

Building algorithms for machine learning, searching in computer graphics, searching in databases

Storing and retrieving data from cache memor

A

Building algorithms for machine learning, searching in computer graphics, searching in databases

56
Q

What is the expected result of an in-order traversal of a binary search tree?

The nodes are visited in descending order of their values

The nodes are visited in ascending order of their values

The nodes are visited in a pre-determined order based on their level in the tree

The nodes are visited in a random order

A

The nodes are visited in ascending order of their values

57
Q

What is a binary search tree (BST)?

A type of tree used for sorting elements in ascending order

A type of binary tree with specific ordering properties

A type of tree used for storing data in a balanced manner

A type of search algorithm that uses a binary approach

A

A type of binary tree with specific ordering properties

58
Q

How is a new node inserted in a binary search tree?

The value is always inserted as the root node

The value is compared with the root and inserted in the left subtree if it’s less or in the right subtree if it’s greater

The value is inserted randomly in any subtree

The value replaces the current root node and becomes the new root

A

The value is compared with the root and inserted in the left subtree if it’s less or in the right subtree if it’s greater

59
Q

How is a node deleted in a binary search tree?

The node is removed and the height of the tree is adjusted accordingly

The node is replaced with the maximum value from the right subtree

The node is replaced with the minimum value from the left subtree

The node is replaced with either the in-order predecessor or the in-order successor, depending on the case

A

The node is replaced with either the in-order predecessor or the in-order successor, depending on the case

60
Q

What is the advantage of using a binary search tree?

Efficient storage of elements in contiguous memory locations

Efficient searching, insertion, and deletion operations

Efficient retrieval of an element at a specific index

Efficient sorting of elements in ascending order

A

Efficient searching, insertion, and deletion operations

61
Q

Which case of imbalance in an AVL tree requires a single left rotation?

LL (Left-Left Imbalance)

RL (Right-Left Imbalance)

LR (Left-Right Imbalance)

RR (Right-Right Imbalance)

A

RR (Right-Right Imbalance)

62
Q

Which case of imbalance in an AVL tree requires a double rotation?

LL (Left-Left Imbalance)

LR (Left-Right Imbalance)

RL (Right-Left Imbalance)

RR (Right-Right Imbalance)

A

LR (Left-Right Imbalance) / RL (Right-Left Imbalance)

63
Q

What are the procedures to maintain a balanced BST?

Add nodes randomly to balance the tree

Perform rotations to balance the tree

Remove all nodes with balance factor greater than 1

Sort the elements in the tree in ascending order

A

Perform rotations to balance the tree

64
Q

What is the balance factor (BF) of a node in an AVL tree?

The minimum height of the left and right subtrees

The difference between the height of the left subtree and the height of the right subtree

The sum of the heights of the left and right subtrees

The maximum height of the left and right subtrees

A

The difference between the height of the left subtree and the height of the right subtree

65
Q

What is an AVL tree?

A tree with arbitrary balance factors

A tree with only left subtrees

A tree with no balance factor

A self-balancing binary search tree

A

A self-balancing binary search tree

66
Q

Which case of imbalance in an AVL tree requires a single right rotation?

LR (Left-Right Imbalance)

LL (Left-Left Imbalance)

RR (Right-Right Imbalance)

RL (Right-Left Imbalance)

A

LL (Left-Left Imbalance)

67
Q

What are the forms of a BST that are not balanced?

Perfect binary trees

Full binary trees

Complete binary trees

Left-skewed and right-skewed trees

A

Left-skewed and right-skewed trees

68
Q

What are the characteristics of a balanced binary search tree?

The heights of the left and right subtrees are determined randomly

The heights of the left and right subtrees differ at most by 1 for every node

The heights of the left and right subtrees are always the same

The heights of the left and right subtrees can differ by any amount

A

The heights of the left and right subtrees differ at most by 1 for every node

69
Q

What are the possible balance factors for a node in an AVL tree?

Show answer choices

−1, 0, 1, or 2

0, 1, or 2

−2, −1, 0, or 1

−1, 0, or 1

A

−1, 0, or 1

70
Q

Which case of imbalance in an AVL tree requires a double rotation?

RR (Right-Right Imbalance)

RL (Right-Left Imbalance)

LR (Left-Right Imbalance)

LL (Left-Left Imbalance)

A

RL (Right-Left Imbalance) / LR (Left-Right Imbalance)

71
Q

What are the characteristics of a heap tree data structure?

It is used in Prim’s algorithm.

It has a binary tree structure.

It allows elements to be accessed in constant time.

It has a heap property that states the data value of any parent node is greater than or equal to the data value of its children.

A

It has a heap property that states the data value of any parent node is greater than or equal to the data value of its children.

72
Q

What is the heap property in a max-heap?

The tree follows a complete binary tree structure.

The data value of any parent node is greater than or equal to the data value of its children.

The data value of any parent node is less than or equal to the data value of its children.

The root of the tree contains the largest data element.

A

The data value of any parent node is greater than or equal to the data value of its children.

73
Q

What does the empty function on the vector indicate in a heap tree implementation?

It checks if the vector is in a valid state.

It checks if the vector is full and no more elements can be added.

It checks if the heap is empty.

It checks if the heap is full and needs resizing.

A

It checks if the heap is empty.

74
Q

What are the steps involved in inserting a new data element in a heap tree?

Append the new data to the end of the tree.

Replace the data of the last (rightmost) leaf node with the new data.

Check if the tree is empty before inserting the new data.

Insert the new data as the next node, check if it violates the heap property, and make necessary swaps if required.

A

Insert the new data as the next node, check if it violates the heap property, and make necessary swaps if required.

75
Q

What are the operations on a heap tree?

Traversal and searching of data elements.

Modification and sorting of data elements.

Creation and manipulation of data elements.

Insertion and deletion of data elements.

A

Insertion and deletion of data elements.

76
Q

What is the heap property in a min-heap?

The root of the tree contains the smallest data element.

The data value of any parent node is less than or equal to the data value of its children.

The data value of any parent node is greater than or equal to the data value of its children.

The tree follows a binary search tree structure.

A

The data value of any parent node is less than or equal to the data value of its children.

77
Q

How is the root element deleted in a max-heap?

Replace the data of the root node with that of the last (rightmost) leaf node and perform heapifyDown to maintain the heap property.

Delete the last leaf node of the tree.

Swap the root element with its largest child.

Perform heapifyUp on the root node.

A

Replace the data of the root node with that of the last (rightmost) leaf node and perform heapifyDown to maintain the heap property.

78
Q

What is an application of a heap tree?

Sorting using heap sort.

Accessing the minimum or maximum element in constant time.

Implementing priority queues.

Finding the minimum cost edge in the Prim’s algorithm.

All of the above.

A

All of the above.

79
Q

What is the purpose of a vector in a heap tree implementation?

It maintains the heap property by comparing the value at a given index with its children nodes.

It adds a new element to the heap by pushing it to the back of the vector and calling heapifyUp.

It maintains the heap property by comparing the value at a given index with its parent node.

It stores elements and allows fast random access to any element.

A

It stores elements and allows fast random access to any element.

80
Q

What is a heap data structure?

A type of sorting algorithm.

A linear arrangement that allows fast random access to any element.

A special type of tree structure that follows a heap property.

A data structure used to maintain the heap property.

A

A special type of tree structure that follows a heap property.

81
Q

What are some operations that can be used in the implementation of a graph data structure?

Add vertex, add edge, remove vertex, remove edge, search for a node, and traverse the graph

Push, pop, enqueue, and dequeue

Sort, merge, and search

Insert, delete, and search

A

Add vertex, add edge, remove vertex, remove edge, search for a node, and traverse the graph

82
Q

What are the terminologies used in a graph data structure?

Nodes and pointers

Vertices and edges

Leaves and parents

Indexes and elements

A

Vertices and edges

83
Q

What is an undirected graph?

A graph where each node is connected with all other nodes

A graph where each vertex has an in-degree and an out-degree

A graph where the edges have no direction

A graph where the edges form an ordered pair

A

A graph where the edges have no direction

84
Q

What is a graph data structure?

A linear data structure used to store a collection of elements.

A data structure that stores data in a hierarchical manner.

A finite collection of interlinked data represented by a set of vertices and edges.

A data structure used to implement stacks and queues.

A

A finite collection of interlinked data represented by a set of vertices and edges.

85
Q

What is a complete graph?

A graph with two or more disconnected graphs

A graph where the edges have no direction

A graph where every node is connected with all other nodes

A graph with a cycle consisting of a single arc

A

A graph where every node is connected with all other nodes

86
Q

What are two common graph traversal algorithms?

Selection Sort and Bubble Sort

Insertion Sort and Merge Sort

Breadth First Search (BFS) and Depth First Search (DFS)

Linear Search and Binary Search

A

Breadth First Search (BFS) and Depth First Search (DFS)

87
Q

What are some applications that can be solved using a graph data structure?

Performing mathematical calculations

Finding shortest routes, planning computer networks, social networking, representing website structures

Storing and retrieving data

Searching and sorting data

A

Finding shortest routes, planning computer networks, social networking, representing website structures

88
Q

How do we represent a graph in a solution?

By using an array

By using an adjacency matrix or an adjacency list

By using a hash table

By using a linked list

A

By using an adjacency matrix or an adjacency list

89
Q

What is a path in a graph?

A sequence of nodes that are followed in order to reach some terminal node from an initial node

A cycle in the graph

A complete graph with all nodes connected

A set of adjacent vertices

A

A sequence of nodes that are followed in order to reach some terminal node from an initial node

90
Q

What is a cycle in a graph?

A path consisting of at least three vertices that starts and ends with the same vertex

A graph where all nodes are connected with all other nodes

A set of disjoint graphs

A loop in the graph

A

A path consisting of at least three vertices that starts and ends with the same vertex