CSCI 255 Fall 2025
Introduction to Algorithms
Charles Cusack
Computer Science
Hope College
Main
Schedule
Grading
Gradebook
Homework

Policies
Advice
College
    Policies

Notes
Programs
Tutorials
Handin

CSCI 125
CSCI 255
Others

Admin

Homework 16

General Comments

  • For full credit, provide context for each problem, show all calculations, and justify all answers by providing enough comments to explain your reasoning.
  • Homework assignments must be very neatly written or typeset (e.g. using Word or OpenOffice).
  • You can get up to 50% credit on a problem if you get significant outside assistance. Thus, if you are totally stuck on a problem it might be worth getting help. However, you must indicate any assistance/collaboration (See the Homework Assistance section on the Policies page). Failure to do so could result in a failing grade for the course! Note that getting help from the Help Center or me does not count as significant outside assistance, but talking with your classmates or searching on the Internet does!
  • If a problem asks for an algorithm, you should give the most efficient algorithm you can find to ensure full credit. You should also specify the complexity of the algorithm with justification, whether or not the problem asks for it.

Details

  1. (10) Compute \(13^{1303} \bmod 101\) by hand using
    1. LTR Binary Exponentiation
    2. RTL Binary Exponentiation
    Show all of your work (which should be a table with 3-5 columns for each computation). You are permitted to verify that your answer is correct with the use of a computer or calculator. In case it is not clear, you may do all of your intermediate computations modulo 101 and you will still get the same answer. For instance, \(13*13=169=68 \bmod 101\), so you can use 68 instead of 169 in the next calculation.
  2. (20) Show all of the steps of inserting the letter of ALGORITHMS into each of the following data structures in order (e.g. A, then L, etc.)
    1. A regular (unbalanced) BST
    2. An AVL tree
    3. A Min Heap
    4. A Max Heap