Searching, Sorting, Graphs Flashcards

1
Q

Two searching algorithms

A
  • linear (or sequential) search

- binary search

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

Sorting algorithms

A
  • insertion sort

- quicksort

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

Recursion

A

Calling a the function inside the function

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

A graph is

A
  • a collection of vertices

- connected by edges

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

Order of a graph

A

Number is vertices it has

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

Size of a graph

A

Number is edges the graph has

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

Degree of vertex

A

Number of edges incident to that vertex

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

Path

A

Is a sequence of vertices and edges (without repetition) that connects two vertices

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

Length of path

A

The number of edges in the path

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

Cycle

A

A path of min 1, starting and ending at the same vertex

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

Connected graph

A

If every pair of vertices there exists at least one path

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

Disconnected graph

A

Consists of at least two connected components

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

Trees

A
  • a connected graph with no cycles

- there exists only one path between any given two vertices

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

Forest

A

Disconnected graph composed by multiple trees

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

Directed graph or digraph

A

-is a graph whose edges have a direction

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

Directed edges or arcs

A

Edges in a directed graph

17
Q

Directed path

A

Is a path following the direction of the edges

-the endpoints are usually referred to as the source and destination

18
Q

Depth first search

A
  • can be used to find if a path exists between to vertices

- used to explore all vertices in a connected component of a graph, starting from a given source vertex v

19
Q

Tree edges or discovery edges

A

Edges used to perform the traversal

20
Q

Back edges

A

Edges connected that would take us back on an explored part of our path

21
Q

Breadth-first search

A

-to explore and backtrack easily, uses a queue instead of a stack

22
Q

Cross edge

A

Is an edge that would take is to the vertex who is not an ancestor and has been visited before

23
Q

Parent, ancestor, sibling

A
  • parent: is the previous vertex that got to the other vertex
  • ancestor: original one that is in the lineage
  • siblings: share a common ancestor
24
Q

Weighted graphs

A
  • used to represent the distance between two things

- also used to represent cost

25
Q

Dijkstra’s algorithm

A

Finds the shortest possible path to get to a certain vertex