Draw a sketch of a doubly-linked list

Assignment Help C/C++ Programming
Reference no: EM132080039

You need help with these three questions. Please answer all of them

1. Draw a sketch of a doubly-linked list, specifically of class DLinkedList in DLinkedList.h, containing the first four words of your favorite song (one word in each node). Make sure to show the DLinkedList object, all node objects, and all objects' data members and pointers.

2. Complete the following main function to create your linked list above (Your code should go in only the indicated space - do not change any other code).

#include <iostream>

#include <string>

#include "DLinkedList.h"

using namespace std;

int main()

{

DLinkedList<string> lyrics;

// YOUR CODE TO CREATE THE LIST GOES HERE

cout << lyrics.front() << endl;

}

3. Write the following new member function for the DLinkedList class. The member function must swap the first and second data nodes (not the sentinels) in the linked list (other data nodes stay as they are). Throw an exception if the list has fewer than two elements. Your code should go in only the indicated space (in DLinkedList.h) - do not change any other code.

template <typename E>

void DLinkedList<E>::swapFirstAndSecond(){

// YOUR CODE TO SWAP NODES GOES HERE

}

Test that your code works by again printing out the front of the list in your main function after calling lyrics.swapFirstAndSecond().

Include a screen capture of the output of your program

Reference no: EM132080039

Questions Cloud

Write a sed script called activity61 to format : Write a sed script called activity61 to format the above file as: FullNname PhoneNumber EmailAddress
What is tom income tax basis in the property : Tom and Elizabeth purchase land for $1 million-Tom furnishes $400,000 and Elizabeth $600,000 of the purchase price.
Determine the amount of the premium on the day of issue : On January 1, 2016, Young Company issued bonds with a face value of $300,000, Determine the amount of the premium on the day of issue
Determine the factory overhead rate : Tin y Biggs Company operates two factories. The company applies factory overhead to jobs on the basis of machine hours in Factory 1 and on the basis of direct.
Draw a sketch of a doubly-linked list : Draw a sketch of a doubly-linked list, specifically of class DLinkedList in DLinkedList.h, containing the first four words of your favorite song.
Calculate the amount of the insurance claim : Required: Calculate the amount of the insurance claim to be filed for the inventory destroyed in the tornado
What is the cell reuse distance : What is the cell reuse distance for a 15 km cell radius with a k=6?
Controversial issue in our political environment : Immigration is an example of a topic that is a controversial issue in our political environment.
Write a verilog module for an odd parity generator circuit : Write a Verilog module for an odd parity generator circuit. The data message is 4 bits. Use Verilog bitwise operators. Do not use always blocks.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd