The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
This is a Python programming course I'm taking in CIS-214 Data Structures. I'm not sure how to work this assignment. I will attach the all documents. Please help and if possible reply back within an hour or two. Â Thanks for all of your help.
Â
# This program exercises arrays and linked lists of nodes.# Replace any "<your code>" comments with your own code statement(s)# to accomplish the specified task.# Do not change any other code.from arrays import Arrayfrom node import Node# Here is the array:theArray = Array(10)for i in range(len(theArray)):theArray[i] = i + 1# Print the array:print("The array structure:")print(theArray)head = Node(theArray[0], None)tail = head# Part 1:# Copy the array items to a linked structure:# The linked structure must consist of Node class items.# You must use some form of a loop to create the linked structure.#<your code>print() # blank line# Part 2:print("The linked structure:")# Print the linked structure with each item on a separate line.# You must use some form of a loop to print the linked structure.#<your code>
Programming Activity 2 - Guidance=================================Part 1------In the starter code, tail should be used to keep track of the last itemin the linked structure, as the items are added to the end one-by-one in a loop.Part 2------Start at head and traverse through the linked nodes.Print each node's data value as you encounter it.Programming Activity 2 - Expected Output=================================The array structure:[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]The linked structure:12345678910
Attachments:
-----------