DSA Flashcards

We got this. I trust myself

1
Q

What’s big O notation

A

It is a way of analyzing the run time (amount of time taken for the algorithm to execute) as the input size grows.
(how the run time grows)

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

What is O(1)?

A

Time doesn’t change based on input. Most efficient.

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

What is a data structure?

A

A component used to store and organize data in a computer so that it can be used and stored efficiently.

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

What is integer overflow?

A

An integer overflow is a type of an arithmetic overflow error when the result of an integer operation does not fit within the allocated memory space. Instead of an error in the program, it usually causes the result to be unexpected.

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

What is the complexity of binary search? why?

A

O(logn). The input size decreases, as the steps increases. Array cut in half.

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

What is a brute force algorithm? Give examples.

A

Finds all possible solutions to find a satisfactory solution for a given problem. Eg - linear search,

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

What is a divide and conquer algorithm?

A

recursively breaks down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly.

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

What condition should be met to do binary search?

A

Array must be sorted

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