Well the code does run.

Of course the first thing missing is short description of what the code does.
I had to run it to see what it did.
like perhaps:

/* Makes a linked list with new items inserted at the front. The list is then searched to find the last item (the item first inserted) and then the list is modified to remove all entries with data less than that item. The list is printed after all insertions and again after the deletions. */
The code does demo some basic understanding of linked lists.
However there is some bizarre stuff...
reverseList() is not at all necessary (unless that was part of the problem assignment).
If that was part of the assignment, then I would expect that there would have been a requirement to print the reversed list.

The algorithm to delete all items less than the last one, traverses the list 3 times. Once to reverse the list to find the "last"; process list to delete items less than the "last"; reverse the list again.
It is only necessary to traverse the list twice. Once to find the "tail". And once to "shorten" the list. reverseList() appears to be unnecessary code.

Update: If anybody out there wants to take on a significant C freeware project, I am interested in re-coding agrep, a approximate matching version of grep. The speed of this thing is stunning. The algorithms are excellent and generated 2 Phd's. Unfortunately, the authors weren't very good C coders and the software has issues. This thing will occasionally miss matches that it should have found. The last I heard from the maintainer, a complete re-write is in order.


In reply to Re^11: [OT:] Is this Curriculum right? by Marshall
in thread [OT:] Is this Curriculum right? by karlgoethebier

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.