DSA Flashcards
We got this. I trust myself
What’s big O notation
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)
What is O(1)?
Time doesn’t change based on input. Most efficient.
What is a data structure?
A component used to store and organize data in a computer so that it can be used and stored efficiently.
What is integer overflow?
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.
What is the complexity of binary search? why?
O(logn). The input size decreases, as the steps increases. Array cut in half.
What is a brute force algorithm? Give examples.
Finds all possible solutions to find a satisfactory solution for a given problem. Eg - linear search,
What is a divide and conquer algorithm?
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.
What condition should be met to do binary search?
Array must be sorted