Java DS and Algo MasterClass Flashcards

1
Q

what is a datastructure?

A

it’s a way to organize data to be used effectively

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

what is an algorithm?

A

it’s a step by step instructions to perform a task

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

what makes a good algorithm?

A
  • correctness

- efficiency

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

what are the types of data structures?

A

primitive : float , int , char

non primitive

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

what are the types of non primitive data structures?

A

Linear

Non Linear

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

what are the types of Linear DS?

A

Static

Dynamic

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

what are the types of Static DS?

A

Array

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

what are the types of Dynamic DS?

A

LS
Stacks
Queues

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

what are the types of non Linear DS?

A

Tree

Graph

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

what are the types of algorithms?

A
  • simple recursive algorithms
  • divide and conquer algorithms
  • dynamic programming algorithm
  • greedy algorithms
  • brute force algorithms
  • randomized algorithms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is recursion?

A

a way of solving a problem by having a function calling itself

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

what are the properties of recursion?

A
  • performing the same operation but with different inputs
  • in every step we try to make the input smaller to make the problem smaller
  • base condition is needed to stop the recursion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the big O for multiple recursive calls?

A

O(branch ^ depth)

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

what are the properties of an array?

A
  • fixed size
  • contiguous in memory
  • same data type
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are the steps of creating an array?

A
  • declare a variable that stores the address of the first element of the array
  • instantiate an array : this is the block of memory that we need for the array with 0 values
  • initialization of the array : start assigning values to the array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly