News
Entertainment
Science & Technology
Life
Culture & Art
Hobbies
News
Entertainment
Science & Technology
Culture & Art
Hobbies
1. Python Programming: What You Need to Know Python is a powerful, high-level programming language created by Guido van Rossum in 1991. It is used for a wide range of applications, from web development to data science. Python is easy to learn, simple to use, and can be used for both large and small projects. In this article, we'll cover the basics of Python programming and give you the tools you need to get started.
Program 1 # Static implementation of Queue import os MAXSIZE=10 rear=-1 front=-1 myqueue=[] # Queue def myinsert(): global rear global front global MAXSIZE if(rear==MAXSIZE-1): print("Queue is oeverflow") else: n=int(input("Enter an element: ")) if(rear==-1 and...
Program 1 # Queue implementation using list myqueue=[] # Queue def qinsert(): n=int(input("Enter an element: ")) myqueue.append(n) def qdelete(): if(len(myqueue)==0): print("Queue is empty") else: print("Deleted element is: ",myqueue[0]) del myqueue[0] def qdisplay(): if(len(myqueue)==0): print("Queue...
Program 1 # Stack Implementation stack=list() def push(): n=int(input("Enter element in stack:")) if(len(stack)==0): stack.append(n) else: stack.insert(0,n) def pop(): if(len(stack)==0): print("Stack is empty") else: print("Poped element is:",stack[0]) del stack[0] def display(): if(len(stack)==0): print("Stack is empty")...
Program 1 # Queue implementation using collections from collections import deque class MyQueue: def __init__(self): self.queue=deque() def qinsert(self): n=int(input("Enter an element for insert")) self.queue.append(n) def qdelete(self): if(len(self.queue)==0): print("Queue is empty") else: print("Deleted element is:...
Program 1 # implementation of circular queue import os MAXSIZE=10 cqueue=[] front=-1 rear=-1 def cqinsert(): global rear global front global MAXSIZE if(((rear+1)%MAXSIZE)==front): print("Queue is overflow") else: n=int(input("Enter an element for insert")) if(front==-1 and rear==-1):...