Pert4 Flashcards

1
Q

Tree yang storing NULL pointer yaitu?

A

Threaded binary tree

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

Syarat Binary Search Tree?

A

– Every node has a key and no two nodes have the
same key (keys are unique).
– Left sub tree’s keys are smaller than root’s key.
– Right sub tree’s keys are larger than root’s key.
– The left and right sub trees are also binary search tree (recursively).

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

4 jenis binary tree?

A
  • PERFECT binary tree is a binary tree in which every level are at the same depth.
  • COMPLETE binary tree is a binary tree in which every level, except possibly the last, is completely filled, and all nodes are as far left as possible. A perfect binary tree is a complete binary tree.
  • SKEWED binary tree is a binary tree in which each node has at most one child.

• BALANCED binary tree is a binary tree in which no leaf is much
farther away from the root than any other leaf (different balancing scheme allows different definitions of “much farther”).

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

what is binary tree?

A

sebuah rooted tree data structure dimana setiap node memiliki paling banyak 2 children

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

Perbedaan array dan linked list

A

Array:

  • Linear collection of data elements
  • Store value in consecutive memory locations
  • Can be random in accessing of data

Linked List:

  • Linear collection of nodes
  • Doesn’t store its nodes in consecutive memory locations
  • Can be accessed only in a sequential manner
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Depth First Search (DFS)

A

algorithm for traversing or searching in a tree or graph. We start at the root of the tree (or some arbitrary node in graph) and explore as far as possible along each branch before backtracking.
DFS has many applications, such as:
• Finding articulation point and bridge in a graph
• Finding connected component
• Topological sorting

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

DFS pake data struktur apa?

A

Stack

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

BFS pake data struktur apa?

A

Queue

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

Stack are widely used to?

A
  • Reverse the order of data
  • Convert infix expression into postfix
  • Convert postfix expression into infix
  • Backtracking problem
  • System stack is used in every recursive function
  • Converting a decimal number into its binary equivalent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Queue Applications?

A
  • Deques
  • Priority Queues
  • Breadth First Search
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Deque?

A

is a list in which elements can be inserted or deleted at either end. It is also known as a head-tail linked list, because elements can be added to or removed from the front (head) or back (tail).

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

Deque dikenal juga?

A

head-tail linked list

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

Priority Queue?

A

an abstract data type in which the each element is assigned a priority.

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

dalam priority queue, lower priority number berarti?

A

higher priority. sort ascending

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

Breadth first search (BFS)?

A

an algorithm for traversing or searching in a tree or graph.
We start at the root of the tree (or some arbitrary node in graph) and explore all neighboring nodes level per level until we find the goal.

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

BFS has many applications, such as:

A

BFS has many applications, such as:
• Finding connected component in a graph.
• Finding shortest path in an unweighted graph.
• Ford-Fulkerson method for computing maximum flow.