Chapter 2: Problem 41
Write a recursive \(\Theta(n \lg n)\) algorithm whose parameters are three integers \(x, n,\) and \(p,\) and which computes the remainder when \(x^{n}\) is divided by \(p\) For simplicity, you may assume that \(n\) is a power of \(2-\) that is, that \(n=2^{k}\) for some positive integer \(k\)
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.