{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

But wait remember what a linkedlist was remember

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: structor for each instance. But wait. Remember what a LinkedList was? Remember LinkedList struct Cust; // forward reference typedef Cust* CustPtr; CustPtr struct Cust { char name[30]; int partysize; Cust *next; }; class LinkedList class LinkedList { public: void Initialise(); void Add(char,int); void Add(char,int void Remove(char,int&); void Remove(char,int private: CustPtr Head; }; Not suitable for a supermarket queue. Applied Programming Applied Programming W e want to be able to create such abstract data We types as linked lists but be able to put any data we desire into these linked lists. we Let's look at another example to illustrate how we Let's can define our own abstract datatypes. datatypes We do that with arrays (built into C++). Let's create a time type. Why can't we do it with our own? We can. What will we call it? How about TimeType. How TimeType We construct generalised classes called templates We'll see these soon. What will it store? time of day in hours, minutes & seconds Applied Programming W hat operations do we want to be able to do with Wh...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern