Skip to main content

Posts

Showing posts from June, 2014

Linked List using PYTHON

This is a gentle intro into data structures using python.This is my personal learning experience and to take a note of what i am learning.Please feel free to comment In this post I have tried to implement a simple Linked List using Python. First I have created a file named LList.py which will contain the following code.Then i would be using this as a module in my main file to create a implementation using these #Single node creation class class Element:     def __init__(self, x):         self.data = x         self.next = None #Linked List implementation class class LinkedList:     def __init__(self):         self.head = None         self.tail = None     def append(self, x):         e = Element(x)         if self.head is None :             self.head = e             self.tail = e         else :             self.tail.next = e             self.tail = e     def showlist(self):         e = self.head         while e.next is no