Skip to content

Commit

Permalink
error in orders
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshlinux committed May 17, 2020
1 parent 3afff8b commit 703d12a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions DataStructure/queue.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#function to add element at the end of list
def add_element(stack,x):
stack.append(x)
def add_element(queue,x):
queue.append(x)
#function to remove last element from list
def delete_element(stack):
n = len(stack)
def delete_element(queue):
n = len(queue)
if(n<=0):
print("Queue empty....Deletion not possible")
else:
del(stack[0])
del(queue[0])

#function to display stack entry
def display(stack):
if len(stack)<=0:
#function to display queue entry
def display(queue):
if len(queue)<=0:
print("Queue empty...........Nothing to display")
for i in stack:
for i in queue:
print(i,end=" ")
#main program starts from here
x=[]
Expand Down

0 comments on commit 703d12a

Please sign in to comment.