Fundamentals of sequential and parallel algorithms