From cf03d1e3fa7f3513c27e5ffb60af088b222c1b00 Mon Sep 17 00:00:00 2001 From: venu13 Date: Mon, 1 Feb 2021 18:16:53 +0530 Subject: [PATCH 1/2] Update 3_linked_list.py Removed llstr variable in 3_linked_list.py file. --- data_structures/3_LinkedList/3_linked_list.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data_structures/3_LinkedList/3_linked_list.py b/data_structures/3_LinkedList/3_linked_list.py index a6d9466..c4afd6f 100644 --- a/data_structures/3_LinkedList/3_linked_list.py +++ b/data_structures/3_LinkedList/3_linked_list.py @@ -12,11 +12,9 @@ def print(self): print("Linked list is empty") return itr = self.head - llstr = '' while itr: - llstr += str(itr.data)+' --> ' if itr.next else str(itr.data) + print(itr.data, end="-->") if itr.next is not None else print(itr.data) itr = itr.next - print(llstr) def get_length(self): count = 0 From ec6c3ed9cd6ccf51a55dde4989308ab8ce9a3b0e Mon Sep 17 00:00:00 2001 From: venu13 Date: Mon, 1 Feb 2021 18:19:33 +0530 Subject: [PATCH 2/2] Update 3_linked_list.py Removal of is not None statement --- data_structures/3_LinkedList/3_linked_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_structures/3_LinkedList/3_linked_list.py b/data_structures/3_LinkedList/3_linked_list.py index c4afd6f..bfd8887 100644 --- a/data_structures/3_LinkedList/3_linked_list.py +++ b/data_structures/3_LinkedList/3_linked_list.py @@ -13,7 +13,7 @@ def print(self): return itr = self.head while itr: - print(itr.data, end="-->") if itr.next is not None else print(itr.data) + print(itr.data, end="-->") if itr.next else print(itr.data) itr = itr.next def get_length(self): pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy