Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA: Linked list problem I have a node class say: ************************************************ private static class Node { private int data; private Node right; private Node down;

JAVA: Linked list problem

I have a node class say:

************************************************

private static class Node {

private int data;

private Node right;

private Node down;

public Node(Node down, int data, Node right) {

this.down = down;

this.data = data;

this.right = right;

}

}

****************************************************************

I need to make a grid class whose constructor needs to links the rows and columns of the Nodes of for example a 5x4 grid.

so

public class Grid{

private Node head;

public Grid(){

//at (0,0), it would connect to all the nodes below it and all the nodes to the right of it. and so on and so on

//I'd also note it should be a circularly linked list.

}

}

anyhelp settting up that constructor would be appreciated. Lmk if you need more info

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

More Books

Students also viewed these Databases questions

Question

Define line and staff authority

Answered: 1 week ago

Question

Define the process of communication

Answered: 1 week ago

Question

Explain the importance of effective communication

Answered: 1 week ago

Question

* What is the importance of soil testing in civil engineering?

Answered: 1 week ago