联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> C/C++编程C/C++编程

日期:2019-02-24 09:59

Time it Took Matthew

2 hours

What to Submit

A FOLDER named DoublyLinkedList that contains

● A modified version of the CMakeLists.txt that you were given to create an interface

library

○ This CMakeLists.txt is in the folder DoublyLinkedList

● DoublyLinkedList.h

● Any other .h files that make up your solution

○ You will need ones for forward iterators, const forward iterators, reverse iterators,

const reverse iterators, and a node.

○ An example layout has been given to you

Problem Description

You are to implement a templated doubly linked list class and both forward and reverse iterators

over it. The .h files you have been given list what functions in each class you need to implement

and what they are supposed to do. You are of course free to add more members and methods if

you would like.

A doubly linked list is made up of nodes and pointers to the first element (head) and a pointer to

the last element(tail). Each node contains a value, a pointer to the previous element in the list,

and a pointer to the next element in the list. An image of a doubly linked list is below.

Google Test

This project makes use of Google Test. Slides for how to install Google Test can be found here.

A video walkthrough can be found here.

Hints

● Be careful when doing things with the empty list and lists that only have a single item or

operations that reduce the list to a single element

○ You will have to make sure to update head and tail correctly

● A lot of the iterator work is the same and repetitive. Take a look at the

StringClassGenericIterator.h for how to create both const and nonconst iterators without

having to copy and paste code around. I got inspiration for how to do this from this Stack

Overflow post.

○ If you want to copy and paste for the const and nonconst version that is fine

● To get your program to compile as soon as possible you can create functions that do

nothing.

○ This will allow you to then add in features and test your features as you add them

● The testing of your code relies heavily on the iterators so make sure that they are

working


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp