Data Structures Flashcards

1
Q

Tree: What is a height of a node?

A

It is the number of edges on the longest path between that node and a leaf node

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

Tree: What is a height of a tree?

A

It is the number of edges on the longest path between the root and a leaf node

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

Tree: What is a depth of a node?

A

It is the number of edges on the longest path between that node and the root

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

Tree: What is a node’s level?

A

It is defined as by 1 + depth of that node

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

Hashtable: What is a hash table?

A

It is a data structure which holds collection of key-value pairs and which operations of Insertion, Deletion and Lookup takes O(1) time

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

Tree: What number of levels a binary tree should have to hold N elements?

A

Levels = ceiling(log(N+1))

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

Tree: What is height-balanced binary tree?

A

A non-empty binary tree T is balanced if:

  1. Left subtree of T is balanced
  2. Right subtree of T is balanced
  3. The difference between heights of left subtree and right subtree is not more than 1.

Note: An empty tree is height-balanced

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

Tree: What is a full binary tree?

A

It is a tree in which every node other than the leaves has two children.

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

Tree: What is a complete binary tree?

A

It is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible.

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

Graph: What is a strongly connected component (SCC) of a graph?

A

SCC is a subgraph in which any two vertices are connected to each other by a paths.

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

Graph: What is a strongly connected graph?

A

Graph is called strongly connected iff it has only one SCC.

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

Graph: What is a bridge of a graph?

A

The bridge or cut edge of a graph is any edge in a graph whose removal increases number of connected components.

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

Graph: What is an articulation point of a graph?

A

The articulation point of a graph is any node in a graph whose removal increases number of connected components.

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

Graph: What is a bipartite graph?

A

A bipartite graph is one whose vertices can be split into two independent groups U, V such that every edge connects between U and V.

Other definitions:

  • The graph is two colorable
  • The graph with no odd length cycles
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Graph: What is a complete graph?

A

A complete graph is one where there is a unique edge between every pair of nodes.

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