Question: Write COW List with C + + . Write a single function: remove ( ) o Signature and structure need exactly the same o Place

Write COW List with C++.
Write a single function: remove()
o Signature and structure need exactly the same
o Place function in file named (see supplied files):
1. Boustrophedonic.cpp : Function
2. Boustrophedonic.h : Declaration and structure
o Your list will be tested with different dimensions
Make sure you solve the problem in a generalized way without crashing
o You cannot modify the Node.h in any way.
Its needed in the unit tests as is...
o You can add helper functions to Boustrophedonic.h and Boustrophedonic.cpp
All your work should be done in Boustrophedonic.cpp
o Make sure you are not leaking memory
You should delete the Node in your remove function
o Check both Debug and Release mode
o Boustrophedonic list is complete and PRISTINE before you remove one node
o Only ONE node will be removed in the function
o The dimensions of the list are NOT given
o Boustrophedonic list has an even number of columns
o Boustrophedonic list has no restrictions on number of rows
o On deletion, horizontal and vertical connections are preserved across the deleted node
// Node.h
// DO NOT MODIFY
#ifndef NODE_H
#define NODE_H
struct Node
{
public:
Node();
Node(const Node &)= delete;
Node &operator =(const Node &)= delete;
~Node();
public:
Node *pNorth;
Node *pSouth;
Node *pEast;
Node *pWest;
};
#endif
//--- End of File ---
// Node.cpp
// DO NOT MODIFY
#include "Node.h"
Node::Node()
: pNorth(nullptr),
pSouth(nullptr),
pEast(nullptr),
pWest(nullptr)
{
}
Node::~Node()
{
}
//--- End of File ----
// Boustropehedic.h
#ifndef BOUSTROPHEDIC_H
#define BOUSTROPHEDIC_H
#include "Node.h"
class Boustropehedic
{
public:
static void Remove(Node *&head, int row, int col);
// Add extra methods here (if desired):
};
#endif
//--- End of File ---
// Boustropehedic.cpp
#include "Boustrophedonic.h"
void Boustropehedic::Remove(Node *&pHead, int row, int col)
{
// TODO
}
//--- End of File ---
Please fix Boustropehedic.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!