Advanced Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an algorithm?

A

(Informally) Any well-defined computational procedure that takes a set of values as input and produces a set of values as output.

An algorithm is a sequence of computational steps that transforms the input into the output.

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

What are the 4 basic data structures?

A

Arrays - Fixed size and contiguous (in a sequence) in memory

Multi-dimensional arrays -

Lists - A dynamic array

Strings - One dimensional arrays of characters ended by a null character

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

What is Big O?

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

What are the examples of Big O?

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

What is the difference between arrays, strings and lists?

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

How to choose a sort algorithm?

A

These are the different factors that determines what sorting algorithm you use:

-Size of the data set
-Degree of order
-The distribution of the data set
-The amount of information associated with each data item

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

What are the advantages and disadvantages of bubble, selection, merge and quick sorts?

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

What is the difference between divide and conquer and dynamic programming?

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

What is the difference AVL and Red-black trees?

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

Why do we need heaps and treaps?

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

Where do we use B-trees?

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

What are tuples?

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

What are sets?

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

What are dictionaries?

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

What are the features of stacks and queues?

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

When and why do we use linked lists?

A
17
Q

What is the difference between singly, doubly, and circular linked lists?

A
18
Q

Why do we use hash tables?

A
19
Q

What happens if a collision happens in a hash table and how do you avoid them?

A
20
Q

What is the load factor in a hash table?

A
21
Q

What are the differences for four types of linked lists? not sure what that means

A
22
Q

Which data structures are dynamic and what does dynamic mean?

A
23
Q

Why and when do we use AVL?

A
24
Q

Why and when do we use Red-black?

A
25
Q

Why and when do we use Splay?

A
26
Q

Why and when do we use Heap?

A
27
Q

Why and when do we use B-tree?

A
28
Q
A