13Miscellaneous400–430Chapter overviewOverviewIntroduction to Miscellaneous Topics400Discretization401Two Pointers413Fractional Programming418The hanging-line method419Finite State Machine420Foundations of Computation Theory421Byte Order422Josephus Problem423Expression Evaluation424Scheduling Tasks on One Machine425Majority Element Problem426Garsia–Wachs Algorithm42715-puzzle428Kahan summation429Chtholly Tree430Introduction to Space OptimizationOffline Algorithms402Introduction to Offline Algorithms403CDQ divide and conquer404Parallel Binary Search405Introduction to Mo's Algorithm406Mo's algorithm407Mo's Algorithm with Modifications408Mo's Algorithm on Trees409Rollback Mo's algorithm410Two-dimensional Mo's Algorithm411Mo's Algorithm: Secondary Offline Processing412Mo's Algorithm with BitsetsRandomization414Random Number Generators415Randomization Techniques416Hill-Climbing Algorithm417Simulated Annealing