Lab9 - Thomas Nanke CIS 200-001 CIS 200L-001 Lab #9...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Thomas Nanke CIS 200-001 CIS 200L-001 Lab #9 Unordered Linked Lists 3/31/08
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Machine type that I used is the PC with Microsoft XP Professional as the operating system. The compiler type is the Microsoft Visual 6.0 Compiler. The goal of this lab was to implement various functions for an unsorted list as a linked structure. Write out the implementations, and then create a driver to test them with data in a given file. Here is a copy of my source code for lab9.cpp #include "datadefn.h" #include "ListType.h" #include <iostream> #include <cstddef> #include <fstream> using namespace std; struct NodeType; //forward declaration typedef NodeType* NodePtr; struct NodeType { ItemType item; NodePtr next; }; List::List() //Post: listPtr is set to NULL. { listPtr = NULL; } //Copy-constructor for ListType. { NodeType* ptr1; NodeType* ptr2; if(otherList.listPtr == NULL) listPtr = NULL; else { listPtr = new NodeType; listPtr->item = otherList.listPtr->item;
Background image of page 2
ptr1 = otherList.listPtr->next; ptr2 = listPtr; while( ptr1 != NULL) { ptr2->next = new NodeType; ptr2 = ptr2->next;
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/25/2010 for the course CECS CIS 200 taught by Professor Jieshen during the Winter '08 term at University of Michigan-Dearborn.

Page1 / 7

Lab9 - Thomas Nanke CIS 200-001 CIS 200L-001 Lab #9...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online