Albar_237739.cpp - #include <iostream> run this program using the console pauser or add your own getch system"pause or input loop DoublyLinkedList.cpp

Albar_237739.cpp - #include <iostream> run this program...

This preview shows page 1 - 3 out of 5 pages.

#include <iostream> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ // DoublyLinkedList.cpp : This file contains the 'main' function. Program execution begins and ends there. #include <iostream> using namespace std; //Class declaration for class Node class Node { public: int data; Node* next; Node* previous; Node(); Node(int); }; //Function definitions for class Node //Default Constructor Node::Node() { data = 0; //initialize data values with 0 next = NULL; // initialize pointer with NULL previous = NULL; // initialize pointer with NULL } //Overloaded Constructor Node::Node(int x) { data = x; //initialize data using passed argument next = NULL; // initialize pointer with NULL previous = NULL; // initialize pointer with NULL } //Class declaration for class LinkedList class DoublyLinkedList { private: Node* head; public: DoublyLinkedList(); void appendToList(int); void displayListElements(); void deleteLastNode(); void displayReverse(); void deleteFirstNode(); int lengthOfList(); void insertAtFifthIndex(int); }; //Function definitions for class LinkedList //Default Constructor DoublyLinkedList::DoublyLinkedList() {
Image of page 1

Subscribe to view the full document.

head = NULL; } void DoublyLinkedList::appendToList(int integerValue) {
Image of page 2
Image of page 3
  • Fall '19
  • Sir. Kashaf

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

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes