/modernc

My solutions to the challenges in Jens Gustedt's Modern C.

Primary LanguageC

Modern C

My solutions to the challenges in Jens Gustedt's Modern C.

  • Challenge 1 (Sorting) A simple Mergesort implementation that does most of the sorting in place. Merging needs another array of same size to work as I couldn't figure out a way to do it in place when I was writing it.
  • Challenge 2 (Function derivative) Didn't do this challenge as it wasn't very interesting.
  • Challenge 3 (Pi approximation) A Pi approximation using Ramanujan's coverging infinite series using GMP to do higher precision arithmetic. The output string isn't very well formatted but it is readable.
  • Challenge 4 (Union-Find) A simple union-find implementation that works. I don't think it fully complies with the challenge but I had a hard time fully grasping what the structure of the index table was supposed to be like. Initially started with a 1D array and later moved to a 2D as that was much more efficient.