Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 137871b

Browse files
rohankhatwanipoyea
authored andcommitted
feature to add input (TheAlgorithms#749)
1 parent 56de3df commit 137871b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

‎data_structures/linked_list/singly_linked_list.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,20 @@ def reverse(self):
7070

7171
def main():
7272
A = Linked_List()
73-
print("Inserting 10 at Head")
74-
A.insert_head(10)
75-
print("Inserting 0 at Head")
76-
A.insert_head(0)
73+
print("Inserting 1st at Head")
74+
a1=input()
75+
A.insert_head(a1)
76+
print("Inserting 2nd at Head")
77+
a2=input()
78+
A.insert_head(a2)
7779
print("\nPrint List : ")
7880
A.printList()
79-
print("\nInserting 100 at Tail")
80-
A.insert_tail(100)
81-
print("Inserting 1000 at Tail")
82-
A.insert_tail(1000)
81+
print("\nInserting 1st at Tail")
82+
a3=input()
83+
A.insert_tail(a3)
84+
print("Inserting 2nd at Tail")
85+
a4=input()
86+
A.insert_tail(a4)
8387
print("\nPrint List : ")
8488
A.printList()
8589
print("\nDelete Head")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /