Java DS and Algo MasterClass Flashcards
what is a datastructure?
it’s a way to organize data to be used effectively
what is an algorithm?
it’s a step by step instructions to perform a task
what makes a good algorithm?
- correctness
- efficiency
what are the types of data structures?
primitive : float , int , char
non primitive
what are the types of non primitive data structures?
Linear
Non Linear
what are the types of Linear DS?
Static
Dynamic
what are the types of Static DS?
Array
what are the types of Dynamic DS?
LS
Stacks
Queues
what are the types of non Linear DS?
Tree
Graph
what are the types of algorithms?
- simple recursive algorithms
- divide and conquer algorithms
- dynamic programming algorithm
- greedy algorithms
- brute force algorithms
- randomized algorithms
what is recursion?
a way of solving a problem by having a function calling itself
what are the properties of recursion?
- 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
what is the big O for multiple recursive calls?
O(branch ^ depth)
what are the properties of an array?
- fixed size
- contiguous in memory
- same data type
what are the steps of creating an array?
- 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