Create a node class named LinkedNodes that uses up to 4 dynamic pointers to connect it to the other 8 nodes in the structure (a total of 9). Th data in each node will be a unique integer number from 1 through 9. Include in your class definition these functions at a minimum: getVal(), setVal(), getNext(), setNext(), getPrev(), setPrev(), constructor(s) and destructor. Write a simple program to load these nodes into a linked structure. Do not use an array, the pointers will do that for you. You should be able to rea any node from any other node in the structure by traversing a maximum of 2 nodes from the current one. The output from your program should report the traversals between all nodes in the structure, starting with the node whose value is one. (See the example below) Node 1 HN35∞ a 2 4 -> Traverses to Node 1 Node 2 1->2 Node 3 1->3 2->3 2->6->1 3->6->1 3->7->2 4->6->1 4->7->2 4->8->3 5->6->1 5->7->2 5->8->3 6->1 6->1->2 6->1->3 7->1 7->2 7->1->3 8->1 9->1 9->2 9->3 Node 4 Node 5 Node 6 1->5 1->2->6 1->4 2->4 2->5 2->6 3->4 3->5 3->6 4->5 4->6 5->6 Node 7 1->3->7 2->3->7 9->4 3->7 4->7 5->7 6->7 5->9->4 6->1->4 6->1->5 7->1->4 7->1->5 7->2->6 8->1->4 8->1->5 8->2-> 8->3->7 9->1->5 9->2->6 9->3->7 Node 8 Node 9 1->4->8 1->5->9 2->4->8 2->5->9 3->4->8 3->5->9 4->5->9 5->9 6->9 7->9 8->9 4->8 5->8 6->8 7->8 9->4->8

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Create a node class named LinkedNodes that uses up to 4 dynamic pointers to connect it to the other 8 nodes in the structure (a total of 9). The
data in each node will be a unique integer number from 1 through 9. Include in your class definition these functions at a minimum: getVal(),
setVal(), getNext(), setNext(), getPrev(), setPrev(), constructor(s) and destructor.
Write a simple program to load these nodes into a linked structure. Do not use an array, the pointers will do that for you. You should be able to reach
any node from any other node in the structure by traversing a maximum of 2 nodes from the current one. The output from your program should
report the traversals between all nodes in the structure, starting with the node whose value is one. (See the example below)
Node
1
2
3
4
5
6
7
8
9
-> Traverses to
Node 1 Node 2
1->2
2->6->1
3->6->1 3->7->2
4->6->1 4->7->2 4->8->3
5->6->1 5->7->2 5->8->3
6->1->2 6->1->3
7->1->3
8->3
6->1
7->1
8->1
9->1
Node 3
1->3
2->3
7->2
8->2
9->2
9->3
Node 4 Node 5 Node 6
1->4 1->5 1->2->6
2->4 2->5 2->6
3->4
3->5
3->6
4->5
4->6
5->6
Node 7
1->3->7
2->3->7
9->4
3->7
4->7
5->7
6->7
5->9->4
6->1->4 6->1->5
7->1->4 7->1->5 7->2->6
8->1->4 8->1->5 8->2->6 8->3->7
9->1->5 9->2->6 9->3->7
Node 8 Node 9
1->4->8 1->5->9
2->4->8 2->5->9
3->4->8 3->5->9
4->5->9
5->9
6->9
7->9
8->9
4->8
5->8
6->8
7->8
9->4->8
Transcribed Image Text:Create a node class named LinkedNodes that uses up to 4 dynamic pointers to connect it to the other 8 nodes in the structure (a total of 9). The data in each node will be a unique integer number from 1 through 9. Include in your class definition these functions at a minimum: getVal(), setVal(), getNext(), setNext(), getPrev(), setPrev(), constructor(s) and destructor. Write a simple program to load these nodes into a linked structure. Do not use an array, the pointers will do that for you. You should be able to reach any node from any other node in the structure by traversing a maximum of 2 nodes from the current one. The output from your program should report the traversals between all nodes in the structure, starting with the node whose value is one. (See the example below) Node 1 2 3 4 5 6 7 8 9 -> Traverses to Node 1 Node 2 1->2 2->6->1 3->6->1 3->7->2 4->6->1 4->7->2 4->8->3 5->6->1 5->7->2 5->8->3 6->1->2 6->1->3 7->1->3 8->3 6->1 7->1 8->1 9->1 Node 3 1->3 2->3 7->2 8->2 9->2 9->3 Node 4 Node 5 Node 6 1->4 1->5 1->2->6 2->4 2->5 2->6 3->4 3->5 3->6 4->5 4->6 5->6 Node 7 1->3->7 2->3->7 9->4 3->7 4->7 5->7 6->7 5->9->4 6->1->4 6->1->5 7->1->4 7->1->5 7->2->6 8->1->4 8->1->5 8->2->6 8->3->7 9->1->5 9->2->6 9->3->7 Node 8 Node 9 1->4->8 1->5->9 2->4->8 2->5->9 3->4->8 3->5->9 4->5->9 5->9 6->9 7->9 8->9 4->8 5->8 6->8 7->8 9->4->8
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Lists
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education