All Flashcards

1
Q

What is the growth time for binary search?

A

O(log n)

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

What is an example of an O(n) algorithm?

A

Simple search

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

What is an example of an O(n * log n) algorithm

A

Quicksort

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

How does array storage differ from linked list storage?

A

Arrays store elements sequentially, while linked lists store elements with pointers to the next element.

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

What are the two cases in recursive functions?

A

Base case and recursive case

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

What is good about Hash tables?

A

fast search, insert, and delete operations

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

What is the main purpose of breadth-first search?

A

to find the shortest path between two nodes.

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

What distinguishes a tree from other graphs?

A

Trees don’t have cycles

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

What is Dijkstra’s algorithm used for?

A

to find the shortest path in a weighted graph with nonnegative weights.

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

How do greedy algorithms work?

A

Greedy algorithms make locally optimal choices in the hope of achieving a globally optimal solution.

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

What is KNN used for?

A

classification and regression

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

What is classification

A

categorization into a group

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

What is regression

A

predicting a response

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

What does NP-hard mean?

A

if every problem in NP can be reduced to it.

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

What does NP-Complete mean?

A

If a problem is in both NP and NP-hard

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

How does Divide & Conquer work?

A

By breaking down a problem into smaller and smaller pieces.

17
Q

How do you make a Hash Table

A

by combining a hash function with an array

18
Q

What is the order followed by a queue?

A

FIFO (First In First Out)

19
Q

What is the order followed by a stack?

A

LIFO (Last In First Out)

20
Q

What is the international standard character encoding

21
Q

What is the most common character encoding

22
Q

How do AVL trees balance themselves?

A

By rotation

23
Q

What algorithm should be used with negative weights

A

Bellman-Fords algorithm

24
Q

What is feature extraction

A

converting an item into a list of numbers that can be compared

25
Q

What is Euclid’s algorithm

A

It is used to find the greatest common factor