FlashKeepers

Discrete Math · College

Discrete Math: Trees and Algorithms

Tree structures and basic graph algorithms such as shortest path and minimum spanning tree, from an intro discrete mathematics course.

29 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone
What is a tree in graph theory?
A connected undirected graph with no cycles
What is a leaf node in a tree?
A node with degree 1 (connected by exactly one edge)
What is the height of a tree?
The length of the longest path from the root to any leaf
What is the depth of a node in a rooted tree?
The number of edges from the root to that node
How many edges does a tree with n vertices have?
Exactly n - 1 edges
What is a spanning tree of a connected graph G?
A subgraph that is a tree and includes all vertices of G
What is a minimum spanning tree (MST)?
A spanning tree with the smallest possible sum of edge weights
What problem does Dijkstra's algorithm solve?
Finding the shortest path from a source vertex to all other vertices
What problem does Kruskal's algorithm solve?
Finding a minimum spanning tree
What problem does Prim's algorithm solve?
Finding a minimum spanning tree
What is a binary tree?
A tree where each node has at most two children
What is a complete binary tree?
A binary tree where all levels are fully filled except the last, which fills from left to right
What is the time complexity of depth-first search (DFS)?
O(V + E), where V is vertices and E is edges
What is the time complexity of breadth-first search (BFS)?
O(V + E), where V is vertices and E is edges
What is a rooted tree?
A tree with one distinguished node designated as the root

14 more cards in the app