class ListNode:
    def __init__(self, data):
        self.data = data

"""
Explanation: Linked Structures

Arrays are basic sequence containe with easy and direct access to the individual elements however they are limited in their functionality

Python lists implemented using an array structure, which extends arrays' functionality by providing largers sets of operations. 


Fixed array size, insertion and deletion times, are some problems of Arrays, and Python lists. 

Linked list data structure can be used to store a collection in linear order. 
Several variaties of linked liss are singly linked lists, and doubly linked lists.

Introduction
Let's create a basic class containing sigle data field:
End of explanation
"""


a = ListNode(11)
b = ListNode(52)
c = ListNode(18)

print(a)

"""
Explanation: This is will give us just the containers that we can store data into.
End of explanation
"""


class ListNode:
    def __init__(self, data):
        self.data = data
        self.next = None

# Initial creation of nodes
a = ListNode(11)
b = ListNode(52)
c = ListNode(18)


"""
Explanation: Since we did not define a method to show the value stored, we cannot see the value. However the values we passed to each variable is stored. 

Now to make it a linked list, we have to establish a connection. To achieve this we can add another data field called next into our constructor.
End of explanation
"""


a.next = b
b.next = c

print(a.data) # Prints the first node
print(a.next.data) # Prints the b
print(a.next.next.data) # Prints the c

"""
Explanation: After modifying the ListNode class and creating nodes for testing we need to use next field to assign it to next node to establish a connection.
End of explanation
"""


