News
Entertainment
Science & Technology
Life
Culture & Art
Hobbies
News
Entertainment
Science & Technology
Culture & Art
Hobbies
Program 1 # Implementation of circular double linked list import os class Node: def __init__(self): self.ladd=None self.data=None self.radd=None class CircularDoubleList: def __init__(self): self.start=None self.count=0 def create(self): n=int(input("Enter first element: ")) self.start=Node() self.start.ladd=None self.start.data=n self.start.radd=None...
Program 1 # Implementation of Binary Search import os os.system('cls') mylist=[] n=int(input("Enter the limit: ")) print("Enter an element: ") for i in range(n): x=int(input()) mylist.append(x) mylist.sort() s=int(input("Enter an element for search: ")) low=0 high=n-1...
Program 1 # Implementation of linear search import os os.system('cls') mylist=[] # list n=int(input("Enter the limit: ")) print("Enter Elements: ") for i in range(n): x=int(input()) mylist.append(x) s=int(input("Enter an element for search: ")) flag=False for...
Program 1 #Implementation of linear sort import os os.system('cls') mylist=[] n=int(input("Enter the limit : ")) print("Enter an elements ") for i in range(n): x=int(input()) mylist.append(x) for i in range(0,n): for j in range(i+1,n): if(mylist[j]<mylist[i]):...
Program 1 #Implementation of stack using collections from collections import deque class MyStack: def __init__(self): self.stack=deque() def push(self,item): self.stack.append(item) print("Pushed : ",item) def pop(self): if(len(self.stack)==0): print("Stack is empty , can not pop element") else:...
Program 1 # Queue Linked list import os class Node: def __init__(self): self.data=None self.add=None class QueueLinkedList: def __init__(self): self.start=None def create(self): n=int(input("Enter First element: ")) self.start=Node() self.start.data=n self.start.add=None self.temp=self.start ch=input("Wan to continue(Y/y): ") while(ch=='y'...
Program 1 # Circular Linked list import os class Node: def __init__(self): self.data=None self.add=None class CircularLinkedList: def __init__(self): self.start=None self.count=0 def create(self): n=int(input("Enter First element : ")) self.start=Node() self.start.data=n self.start.add=None temp=self.start self.count=self.count+1 choice=input("Want to...
Program 1 # Implementation of double linked list import os class Node: def __init__(self): self.ladd=None self.data=None self.radd=None class DoubleLinkedList: def __init__(self): self.start=None self.count=0 def create(self): n=int(input("Enter first element: ")) self.start=Node() self.start.ladd=None self.start.data=n self.start.radd=None temp=self.start...
Master Python with 70+ Hands-on Projects and Get Job-ready - Learn Python Program 1 # Currency Covert Project from forex_python.converter import CurrencyRates def currency_covert(): c=CurrencyRates() try: print("------------Currency Covertor-------------------") from_currency=input("Enter base currency(i.e USD INR EUR)")...
Get Job-ready: Java Course with 45+ Real-time Projects! - Learn Java Program 1 // Sales Data Analysis package src; import java.awt.*; import java.awt.event.*; import java.sql.*; import javax.swing.*; import javax.swing.table.DefaultTableModel; public class SalesAnalyticsApp extends JFrame...
Program 1 # Implementation of Priority Queue using Module Min Heap import queue import os class MyPQueue: def __init__(self): self.pq=queue.PriorityQueue() def insert(self): n=int(input("Enter an element: ")) self.pq.put(n) def delete(self): if(self.pq.empty()): print("Priorty queue is empty")...
Program 1 # Implementation of single linked list import os class Node: def __init__(self): self.data=None self.add=None class LinkedList: def __init__(self): self.start=None self.count=0 def create(self): n=int(input("Enter First element: ")) self.start=Node() self.start.data=n self.start.add=None self.temp=self.start self.count=self.count+1 ch=input("Wan...
Program 1 # Static implementation of Stack import os MAXSIZE=10 top=-1 mystack=[] def push(): global MAXSIZE global top if(top==MAXSIZE-1): print("Stack is overflow") else: n=int(input("Enter an element for push: ")) top=top+1 mystack.insert(top,n) def pop(): global...
Program 1 # Implementation of single linked list import os class Node: def __init__(self): self.data=None self.add=None class LinkedList: def __init__(self): self.start=None self.count=0 def create(self): n=int(input("Enter First element: ")) self.start=Node() self.start.data=n self.start.add=None self.temp=self.start self.count=self.count+1 ch=input("Wan...
Program 1 # Stack Linked list import os class Node: def __init__(self): self.data=None self.add=None class StackLinkedList: def __init__(self): self.start=None self.count=0 def create(self): n=int(input("Enter First element: ")) self.start=Node() self.start.data=n self.start.add=None self.temp=self.start self.count=self.count+1 ch=input("Wan to continue(Y/y):...
Master C++ with Real-time Projects and Kickstart Your Career Start Now!! Program 1 //Object Oriented Based Banking System with File Storage #include <iostream> #include <fstream> #include <string> using namespace std; class BankAccount { private:...
Master C++ with Real-time Projects and Kickstart Your Career Start Now!! Program 1 //Parking Lot Management System #include <iostream> using namespace std; class ParkingLot { private: int twoWheelerCount; int fourWheelerCount; const int maxTwoWheelers; const...
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 # 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...
Master C++ with Real-time Projects and Kickstart Your Career Start Now!! Program 1 // Bank Application Project with File Storage #include<iostream> #include<fstream> // For file handling using namespace std; class Bank { private: int...
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 # 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 # 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):...
Master C++ with Real-time Projects and Kickstart Your Career Start Now!! Program 1 // Dynamic memory allocation in C++ #include<iostream> using namespace std; int main() { system("cls"); int *ar,n,sum=0; cout<<"Enter the limit: "<<endl; cin>>n;...