Searching, Sorting, Graphs Flashcards
Two searching algorithms
- linear (or sequential) search
- binary search
Sorting algorithms
- insertion sort
- quicksort
Recursion
Calling a the function inside the function
A graph is
- a collection of vertices
- connected by edges
Order of a graph
Number is vertices it has
Size of a graph
Number is edges the graph has
Degree of vertex
Number of edges incident to that vertex
Path
Is a sequence of vertices and edges (without repetition) that connects two vertices
Length of path
The number of edges in the path
Cycle
A path of min 1, starting and ending at the same vertex
Connected graph
If every pair of vertices there exists at least one path
Disconnected graph
Consists of at least two connected components
Trees
- a connected graph with no cycles
- there exists only one path between any given two vertices
Forest
Disconnected graph composed by multiple trees
Directed graph or digraph
-is a graph whose edges have a direction