Lessons Learned: While loops, logarithms
Sameer Khoja
You are playing the following Flip Game with your friend: Given a string that contains only these two characters: + and -, you and your friend take tur…
Sameer Khoja
Lesson Learned: Recursion
Sameer Khoja
Lessons learned: HashMaps, iterations
Sameer Khoja
Write an algorithm to remove every other node from a Circular LinkedList. This week’s solution is short and sweet, so I’ll just display the solution he…
Sameer Khoja
Question: Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of "chunks" (partitions), and in…
Sameer Khoja
Lessons Learned: Strings, For Loops
Sameer Khoja
Question 9: Given a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If targ…
Sameer Khoja
Time complexity
Sameer Khoja
Lessons Learned: binary search, randomization
Sameer Khoja
Question 8: T1 and T2 are two very large binary trees, with T1 much bigger than T2. Create an algorithm to determine if T2 is a subtree of T1. One way …
Sameer Khoja
Lessons Learned: Stacks,
Sameer Khoja