CS200 Assignment 3-Linked List
CS200 Assignment 3-Linked List
13 March 2024
Programming Conventions
(See: C++ Language Coding Guidelines)
Total
100
Move to the next page to view the assignment.
Let’s Begin …
CS 200 Assignment 03 Spring 2024. 13 March 2024
Entangled Web
Achieving your goals primarily depends on hard work and following the clues, with luck playing a
secondary role. Your objective is to reach the target node within the interconnected network of linked
lists called Entangled Web shown in Figure 1.
• int data
• node* up
• node* down
• node* left
• node* right
The Linked List structure you must create will look similar to the structure shown in Figure 1 Entangled
Web. You will have to search for the target node in such a grid.
To find the target node, you will start from the top-left most node of the grid and then jump to the next
node in the sequence using the ‘data’ as a clue. Also, note that the value of ‘data’ for each node must be
unique and positive.
The location of the next node to visit will be discovered using the following formulas:
Sample Input:
Figure 2 shows a sample input to your program.
Output:
• 3401->18->7017->2->118->101
• Target Node = 101
Implement:
• Accurate creation of the Node. [5]
• Accurate creation of the Linked List Class along with its associated Constructors, Parameterised
Constructors, Destructors, and proper member variables specified above. [10]
• Member function to take as input the dimensions of the grid to be created as well as the data to
be stored in each node. Store each acquired information in a suitable data type and data
structure. [10]
• Member function printEntagledWeb(Node* ) [6]
o Prints the Entangled Web that has been created
• Member function nextRow(int data) [5]
o Returns the row number of the next node to be visited (1st row is called row 1).
• Member function nextColumn(int data) [5]
o Returns the column number of the next node to be visited (1st column is called column
1).
CS 200 Assignment 03 Spring 2024. 13 March 2024
End of Assignment 03