This an assignment I did at university, here’s the link.
javac analyze.java java analyze [inputfile]
Input file should be formed in the following format(note the last comma, if this isn’t added the last input drops),
PS: It’s java btw! If one can convert the sorting techniques to C these would fly I guess…