Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the getNodeAtPosition function of the LinkedList class . Node * LinkedList::getNodeAtPosition(int position) The job of this function is to return a pointer to the

Implement the getNodeAtPosition function of the LinkedList class .

Node * LinkedList::getNodeAtPosition(int position)

The job of this function is to return a pointer to the node the node at the given position. If the list is empty, position <= 0 or position > length, then the function should return the null pointer.

This is a helper function that can be used by various other member functions (e.g. insertAtPosition, removeAtPosition, getValue. setValue).

I started with this:

LinkedList::LinkedList(int myArray[], int size) { if (position <= 0 || position > length) return false; }

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

The means square within (MSW) is equal to ______ divided by dfW.

Answered: 1 week ago