![]() data #as in 3rd last of list word is stored in undo list, so in this we are intializing wprd to word data #as in 2nd last of list index is stored in undo list, so in this we are intializing idx to index data #as in last of list operation is stored in undo list, so in this we are intializing oper to operation next != None: # checking total elements in undo list (self.head_op) head_op # intailizing temp with main list head_op = None: # checking if undo list is empty next = w #in this part and below we are adding and linking dataĭef undo( self): #this functions will operate we undo button will be pressed next != None: #creating a loop to traverse to last node ![]() head_redo #storing head of redo list in temp #elif self.head_=None:Įlse: # this statement will run if redo list is not wmpty head_redo = w #setting word as first node head_redo = None: # checking if redo list is empty then inserting the data in the list W = Node( word) #making 3 variable to store word,index and operations performed. head_redo = None # doubly linked for redo operationĭef isrt_redo( self, word, index, oper): # A function to insert data in redo list head_op = None # doubly linked for undo opreations ![]() head = None # doubly linked for words/ charcters #prev will pint to previous node of current NodeĬlass Text_Editor: # class for Doubly Linked List prev = None #next will to next pointer to current head and Class Node: #class to make NODEsS of Doubly LINK LIST
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |