Questions: 1 680

Answers by our Experts: 1 680

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a C code to add two polynomials using an array.


A system has a 16 byte memory. Therefore it can hold only 8 integers. Initially the

memory is empty. It can perform four operations. They are

1. Push

2. Pop

3. Enqueue and

4. Dequeue

Here Push, Pop operations maintain the rules of a simple stack and Enqueue, Dequeue

operations maintains the rules of a simple queue. If the memory is full then the system discards

any push or enqueue operation and if the memory is empty then it discards pop

and dequeue operations. Now write a program using the concept of stack and queue to

simulate the system.

Input: Test case will start with an input n that contains the numbers of operations. Next n

line will have the operations. Specifications of operations are given below:

E x : Enqueue x // here x is an interger number

D : Dequeue

P x : Push x

O : Pop

Output: Output the final memory status of the system. If the memory is empty print a

message “Memory is Empty”.

Sample input :

12

D

P 7

P 9

E 13

P 17

D

E 19

D

P 23

O

O

E 18

Sample output:

13 17 18


A queue data structure is given with enqueue and dequeue operations. WAP to implement a stack using instances of queue data structure and operations on them


A stack data structure is given with push and pop operations. WAP to implement a queue using instances of stack data structure and operations on them.


Given a Queue consisting of first n natural numbers (in random order). The task is to check whether the given Queue elements can be arranged in increasing order in another Queue using a stack. The operations allowed are:

  1. Push and Pop elements in the stack
  2. Delete from the given Queue.
  3. Insert into another Queue.

Write a C code to replace every element in a linked list with the next greatest element present in the same list.


Write a C code to add two polynomials using array.


Write a C code to replace every element in a linked list with the next greatest element present in

the same list.


Write a program that prompts the user to input a four-digit positive integer. The program then outputs 

the digits of the number, one digit per line. For example, if the input is 3245, the output is:

3

2

4

5


Write a program that prompts the user to input a four-digit positive integer. The program then outputs
the digits of the number, one digit per line
LATEST TUTORIALS
APPROVED BY CLIENTS