Day-5 Flashcards

1
Q

Tree

A

Any connections of nodes with children. We have root on the top and leaf at the bottom.

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

Binary Tree

A

It’s a tree that doesn’t conform to the BST pattern so it has zero up-to 2 children. The order of the children doesn’t matter here as long as we are not searching (leave that for BST).

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

Binary Search Tree (BST)

https://www.icloud.com/keynote/0HsxTSLp6ajYiE8VSwsR5oyUA#Binary_Search_Trees

A

A binary tree where every node has two children. We compare a value to the current node. Less than current node’s value goes to the left of the tree, otherwise goes to the right.

Nodes without children is considered leafs.

A leaf doesn’t have children.

Edges are the connections between nodes.

Depth of a node is the number of edges/connections from then root to the node.

The height of a node is the number of connections from the node to its deepest leaf.

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

O(log) can be explained on Trees awesomely

A

Its always one step when we double our value. From 1 to 2 is one step , from 2 to 4 is one step , from 4 to 8 is one step …..

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