Algorithm

“Data Structures and Algorithm Analysis Note (I)”

Basic Knowledge before learning Algorithm & Data Structures Four basic rules of recursion Base cases Making progress Design rules: Assume that all recursive calls work. Compound Interest Rule: Never duplicate work by solving the same instance of a problem in separate recursive calls. Two most common ways of proving statements: by induction and by contradiction. Modular Arithmetic: A is congruent to B modulo N, written A ≡ B if N divides A – B (The remainder is the same when either A or B is divide by N.

Posted

#Notebook #Algorithm

“Data Structures and Algorithm Analysis Note (II)”

ADT An ADT is a set of operations; ADTs are mathematical abstractions; nowhere in an ADT’s definition is there any mention of how the set of operations is implemented. Operations for the set ADT: Union Intersection Size Complement The List ADT Empty list—the special list of size 0. Operations: Find: returns the position of the 1st occurrence of a key;

Posted

#Notebook #Algorithm