Skip to the content of the web site.

Programming challenges

IEEE Spectrum Magazine    MIT Technology Review    Wired Magazine    EDN Network    EE Times    Skeptic's Guide to the Universe

Authors: Douglas Wilhelm Harder and Prof. Hiren Patel

Here are over 120 programming challenges you can work on.

  1. Polynomial representations
  2. Simple statistics
  3. Simple encryption algorithms
  4. Two- and multi-dimensional arrays
  5. Linear algebra
  6. Dynamic programming
  7. Merge sort
  8. Number theory
  9. Intervals
  10. Morse code
  11. Combinations and permutations
  12. Tournament scheduling
  13. ASCII games
  14. Geometry
  15. Calendars
  16. Estimating $\pi$
  17. Filters
  18. Calculators
  19. Series
  20. Complex numbers
  21. Physics
  22. Strings
  23. Array tools
  24. Navigation
  25. Bitwise operations
  26. Financial algorithms
  27. Probability distributions

A. Polynomial representations

  1. Polynomials as arrays,
  2. Polynomials as linked lists,
  3. Accessing or setting a coefficient,
  4. Retrieving the degree of a polynomial,
  5. Evaluating a polynomial at a point,
  6. Multiplying a polynomial by a scalar and negating a polynomial,
  7. Adding and subtracting two polynomials,
  8. Finding a linear combination of two polynomials,
  9. Multiplying two polynomials,
  10. Multiplying two polynomials-as-array with divide and conquer,
  11. Multiplying two polynomials-as-array with the fast Fourier transform,

B. Simple statistics

  1. Mean and standard deviation (to be written)
  2. Median and order statistics (to be written)
  3. Least squares (to be written)
  4. Approximation uniformly distributed events
  5. Approximation exponentially distributed events
  6. Approximation normally distributed events
  7. The integral of the standard normal distribution

C. Simple encryption algorithms

  1. Stream ciphers
  2. Block ciphers (to be written)
  3. Binary-to-text conversion (ASCII armour)
  4. DRYAD ciphers: the need for pairs

D. Two- and multi-dimensional arrays

  1. Local multi-dimensional arrays
  2. Passing local multi-dimensional arrays as arguments
  3. Dynamically-allocated multi-dimensional arrays
  4. Efficient dynamic multi-dimensional arrays

E. Linear algebra

  1. A mathematical vector class (to be written)
  2. Multiplying by a scalar (to be written)
  3. Adding two vectors (to be written)
  4. Inner product (to be written)
  5. Inner product (to be written)

F. Dynamic programming

  1. Fibonacci numbers, and
  2. Binomial coefficients.

G. Merge sort

  1. Merging sorted lists (to be written)
  2. Merging sort (to be written)

H. Number theory

  1. Sieve of Eratosthenes
  2. Integer roots
  3. Greatest common divisor and least common multiple
  4. Iterative primality testing
  5. The kth prime number

I. Intervals

  1. Intervals
  2. Assignment
  3. Interval arithmetic
  4. Scalar arithmetic
  5. Functions

J. Morse code

  1. Converting to Morse code
  2. Converting from Morse code

K. Combinations, permutations and recursion

  1. n choose k (Lotto 6/49)
  2. Playing without repetition
  3. Factorial function
  4. Binomial coefficients
  5. McCarthy 91 function
  6. Collatz conjecture
  7. Fibonacci numbers
  8. Ackermann function
  9. Gray codes
  10. Subsets
  11. Permutations
  12. de Bruijn sequence

L. Tournament scheduling

  1. Round-robin tournament
  2. Single-elimination tournament
  3. Double-elimination tournament

M. ASCII games

  1. Tic-tac-toe
  2. Rock-scissors-paper
  3. Connect four
  4. Hangman
  5. High-low
  6. Nim
  7. Sliding puzzle (to be written)

N. Geometry

  1. Description of a triangle
  2. Convex hull (gift-wrapping algorithm) (to be written)
  3. Find the mid-point of a line
  4. Determine if three points co-linear
  5. Determine if two line segments intersect
  6. Reflect a point through a line
  7. Reflect a line through a point

Other algorithms to consider including: geeksforgeeks.org.

O. Calendars

  1. Printing the Gregorian calendar
  2. Printing the Islamic calendar
  3. Printing the Julian calendar

If anyone would like to assist in making another project introducing another calendar that can be calculated (for example, the Baha'i calendar with 19 months of 19 days with four or five intercalary days), please contact Douglas Harder Thank you.

P. Estimating $\pi$

  1. Series
  2. Randomized algorithms
  3. Archimedes's method
  4. Efficient series

Q. Filters

  1. Averaging filter
  2. Simple low-pass filter
  3. Simple recursive averaging filter
  4. Differentiation and integration

R. Calculators

  1. Unit conversions
  2. Stack calculator

S. Series

  1. Arithmetic series
  2. Geometric series
  3. Bernoulli numbers

T. Complex number class

U. Physics

  1. Gravitational and electromagnetic force
  2. Time dilation and length contraction
  3. Projectile motion

V. Strings

  1. Lexicographical comparison (to be written)
  2. Capitalization
  3. Pig latin

W. Array tools

  1. Zero-entry queries
  2. Shift and circular shift
  3. Fill
  4. Shrink and resize
  5. Interleave
  6. Find and find all
  7. Partial sums
  8. Concatenate
  9. Reverse
  10. Permute (to be written)
  11. Print
  12. Create a library

X. Navigation

  1. Distance between points in UTM
  2. Angle between points in UTM
  3. Distance between points in latitude and longitude
  4. Angle between points in latitude and longitude

Y. Bit-wise operations

  1. Bit rotations
  2. Arithmetic right shift
  3. First and last 1 et al.
  4. Ones count
  5. Trailing bit manipulations

Z. Financial algorithms

AA. Probability distributions

  1. Bernoulli distribution
  2. Discrete uniform distribution
  3. Continuous uniform distribution
  4. Create a library