Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions