Problem Solving with Algorithms and Data Structures using Python https://www.codesdope.com/course/algorithms-introduction/
- the operatin of insertion and deletion don't mean to insert at specify index, not including the search operation, so the bigO is 1;
-
hashmap: record the key,value
-
doubleLinkedList: put the rencently reading or writing data in front of the list(first delete,then insert at the top);
doubleLinkedList can easily delete and insert;
time complexiy analyze:
-
we need to divide by 2 until with have only one element- 𝑛/(2𝑘)=1
-
we can rewrite it as -
2𝑘=𝑛
by taking log both side, we get
𝑘=log2𝑛
divide big problems into small subproblem;
vs: divide and conquer
the subproblemss are interdependent;
breaking a problems into smaller and smaller problems;
feature:
- algorithm have a base case;
- algorithm must change its state and move toward the base case.
- call itselft recursively
-
what is? an optimization algorithm, optimise rescursion,store the soultion of the subproblems
-
approach: bottom up vs top up
-
feature
solve the prolem withe overlapping subproblems
-
what is? e.g.,quick sort, merge sort, binary search
-
featrue?
solve the problem indepent