Problem Solving
Programing questions solutions in swift
Tries
- Can be use to find prefixs. Some applications are autocomplete search, spell checker etc
- One variation is suffix tree. Best for pattern matching ( most optimized )
- Substring check,
- All occurences of substring
- Finding all distinct substring
DP
A technique to solve optimization problem in breaking down in to overlapping sub problems and finding the solution using those problems. Optimization problems can be of enumerations ( climbing stairs ), max min profit ( stock selling ) or yes or no
A problem is DP if
- it has overlapping sub problems ( sub problems computed more than once )
- optimal sub structure ( solving any problem by solving slving sub problems optimally)
Some improtant algorithm are - Stair case to heaven