C++代写 代写C++程序 C++作业代写 C++程序代写

c++入门代写 c++代写 cpp代写 cpp程序代写

Project 1. Recursive Linked List

The mission is simple: implement a linked list. There will be no new major functions from the prior lab except the Big

3 . However, you will implement each function recursively. Only functions on Node will be recursive, but LinkedList

functions will need to change to support Node. Some of the parameters change, too, so you need to start from the

new base code.

The base code is on iLearn; you will only need to implement LinkedList.cpp. Please do not change LinkedList.h, but

you can change main.cpp to better test your code. Only upload LinkedList.cpp!

If you use iteration (any loops) in your LinkedList.cpp file, you will receive a zero FOR THE PROJECT.

Better to leave functions unimplemented (stub them out to make sure everything compiles)!

Implement the following functions in order:

1. Node::hasNext

LinkedList::empty

2. Node::display

LinkedList::display

3. Node::append

LinkedList::append

The append function for Node should only append to the Node if it's the last Node; otherwise, recurse

4. Node::search

LinkedList::search

Remember, we have to do linear search

5. Node::insertAfter

LinkedList::insertAfter

The insertAfter function for Node should only insert if the current node matches the oldData variable;

otherwise, recurse

6. Node::removeNext

LinkedList::remove

The name of the removeNext function on Node is a strong hint

7. Node::~Node

LinkedList::~LinkedList

8. Node::Node(const Node & source)

LinkedList::LinkedList(const LinkedList & source)

This may be the toughest pair. Hint: given a point of type X, how can you get the X object?

9. LinkedList::operator=

For specific reasons, we don't need to implement an overloaded assignment operator for Node for this

specific assignment. Let me know if you want to know why.

That's it!

京ICP备2025144562号-1
微信
程序代写,编程代写
使用微信扫一扫关注
在线客服
欢迎在线资讯
联系时间: 全天