Graph Theory and Searching Algorithms Review

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

flashcard set

Earn XP

Description and Tags

Practice questions covering graph definitions, searching complexities, adjacency matrices, degrees of nodes, spanning trees, and traversal algorithms based on the lecture notes.

11 Terms

1
New cards

What is an adjacency matrix in the context of a graph?

A square matrix used to represent a finite graph, where the elements indicate whether pairs of vertices are adjacent or not.

2
New cards

In a graph, how are adjacent nodes defined?

Two nodes are considered adjacent if there is an edge connecting them directly.

3
New cards

Define the process of Searching.

Searching is the process of locating a specific element or value within a data structure.

4
New cards

What is the time complexity of a Linear search?

The time complexity of a Linear search is O(n)O(n). outdoor

5
New cards

What is the time complexity of a Binary search?

The time complexity of a Binary search is O(log⁡(n))O(\log(n)), which is more efficient than linear search for sorted data.

6
New cards

Given the specification V(G)={1,2,3,4}V(G) = \{1, 2, 3, 4\} and E(G)={(1,2),(1,3),(3,3),(3,4),(4,1)}E(G) = \{(1, 2), (1, 3), (3, 3), (3, 4), (4, 1)\}, what is the adjacency matrix for this undirected graph?

A 4×44 \times 4 matrix where entries are 1 if an edge exists between nodes ii and jj (treating (3,3)(3, 3) as a self-loop) and 0 otherwise.

7
New cards

What is the difference between a directed graph and an undirected graph?

In a directed graph, edges have a specific direction (arcs), whereas in an undirected graph, edges have no direction and represent a bidirectional relationship.

8
New cards

How do you determine the in-degree and out-degree of a node in a directed graph?

In-degree is the number of edges coming into a node, while out-degree is the number of edges leaving a node.

9
New cards

What is a spanning tree?

A spanning tree is a subset of graph GG that includes all the vertices of GG and is a tree, meaning it is connected and has no cycles.

10
New cards

What is the objective of an algorithm used to find a minimum cost-spanning tree?

To find a spanning tree where the sum of the weights of the edges is minimized.

11
New cards

What do the acronyms BFS and DFS represent in graph traversal?

BFS stands for Breadth-First Search and DFS stands for Depth-First Search.