CIS-3050 Algorithms and Data Structures

Assignment 3

Due:  Wednesday, Oct. 6


This assignment is to extend your SList class.
       
    1.   Add the following new methods:

By Nth element, assume your list is 0 based -- so a request getNth(0) would be the same as getFirst().   A request to getNth(size - 1) would be the same as getLast(). Likewise, insertNth(0, someData) would be the same as insertFirst(someData).     HINT:  Note that this means you really only have to write 3 functions for this assignment; the other three can be one line functions that use the three you do have to write.    When in doubt, draw pictures, and figure out what your pointers have to do for each situation. 

         
To be turned in: 
    1. Your new implementation of the SList class.  This will consist of SList.h and possibly SList.cpp
    2. A program (C++ main) that fully tests the new functionality.  Be sure to test all the public functions.  This can just be an update of your earlier test program.
    3. Within the comments of SList, be sure to mention the runtime performance (Big-Oh notation) of each new function of SList.
    4. There is no need to resubmit your Node class, if it hasn't changed from Assignment 2
Some requirements:


As needed, I can be reached via email, AIM or in my office on the 2nd floor of the 700 building.  See my schedule page for my official office hours. I also anticipate being available during the afternoons until around 4p.    If you do need help, including your source code files in any email to me can be helpful and save time.

Good Luck and Good Coding!