Skip to main content

Posts

Showing posts from October, 2020

Pizza Parlor

  Data Structure Lab Practical 32 : Problem Statement : Pizza parlor accepting maximum M orders. Orders are served in first come first served  basis. Order once placed cannot be cancelled. Write C++ program to simulate the system  using circular queue using array. Check Out Code Here  ðŸ‘‡ Code can get updated so also come back later to see if there is any changes. Also if there is any problem with code you can comment below. Do share with your friends. 😊

Polynomial Addition using Linked List

Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers. Linked List : It is a data structure that stores each element as an object in a node of the list. every node contains three parts two integer part for coefficient(c), exponent(e) and one for next pointer. A linked list that is used to store Polynomial looks like − Polynomial : 4x7 + 12x2 + 45 This is how a linked list represented polynomial looks like. Adding two polynomials that are represented by a linked list. We check values at the exponent value of the node. For the same values of exponent, we will add the coefficients. Example, Input : p1= 13x8 + 7x5 + 32x2 + 54 p2= 3x12 + 17x5 + 3x3 + 98 Output : 3x12 + 13x8 + 24x5 + 3x3 + 32x2 + 152 Check out Code Here 👇 Code can get updated so also come back later to see if there is any changes. Also if there is any problem with code you can comment below. If you like it,

Koch Snowflakes

Computer Graphics    Group B    Practical 5 a   Problem Statement :   Write C++ program to generate snowflake using concept of fractals. Check Out Code Here  ðŸ‘‡ Outputs :    Iteration 0 : Iteration 1 :  Iteration 2 : Iteration 3 : Iteration 4 : Code can get updated so also come back later to see if there is any changes. Also if there is any problem with code you can comment below. If you like it, do share with your friends.😊

DSL E31

Data Structure  Lab : Practical 31 : Problem Statement : A double-ended queue (deque) is a linear list in which additions and deletions may be made at either end. Obtain a data representation mapping a deque into a one dimensional array. Write C++ program to simulate deque with functions to add and delete elements from either end of the deque. Check Out Code Here 👇 // Author : SPPU CSE GURU #include<iostream> using namespace std; class Queue{ int front,rear,max; int Q[10]; public: Queue(){ front=0,rear=-1,max=10; } void InsertFront(int); void InsertRear(int); void DeleteFront(); void DeleteRear(); void Display(); }; void Queue::InsertFront(int data){ if(front==0 && rear==-1){ Q[front]=data; rear++; }

DSL E29

 Data Structure Lab : Practical 29 : Problem Statement:  Queues are frequently used in computer programming, and a typical example is the creation of a job queue by an operating system. If the operating system does not use priorities, then the jobs are processed in the order they enter the system. Write C++ program for simulating job queue. Write functions to add job and delete job from queue Check Out Code Here  ðŸ‘‡ // Author : SPPU CSE GURU #include<iostream> using namespace std; class Queue{ private: int front,rear,max; public: int Q[10]; Queue() { front=0; rear=-1; max=10; } void EnQueue(); void DeQueue(); void Display(); }; void Queue::EnQueue() { int data; cout<<"Enter Job no. to Add "<<endl; cin>>data; if(rear<

DSL D26

Data Structure Lab : Practical D26:   In any language program mostly syntax error occurs due to unbalancing delimiter such as (),{},[]. Write C++ program using stack to check whether given expression is well parenthesized or not. // Author : SE CSE GURU #include<iostream> #include<string> using namespace std; class Parenthesis{ public: int Top,max; char Stack[30]; Parenthesis(){ Top=-1; max=29; } void push(char); char pull(); int isFull(); int isEmpty(); }; void Parenthesis::push(char ch){ if(isFull()){ cout<<"Stack is Overflow "<<endl; } else{ Top++; Stack[Top]=ch; } } char Parenthesis::pull(){ if(isEmpty()