Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Define a method for keeping two stacks within a single linear array S in such a way that neither stack overflows until entire array is used and a whole stack is never shifted to a different location within the array. Write down the routines for pushing and poping elements in two the stacks.
Ans.
/* The Two Stacks Into One Array */
#include
#define MAX 50
int mainarray[MAX];
int top1=-1,top2=MAX;
void push1(int elm)
{
if((top2-top1)==1)
clrscr();
printf("\n Array has been Filled !!!");
return;
}
mainarray[++top1]=elm;
void push2(int elm)
mainarray[--top2]=elm;
int pop1()
int temp;
if(top1<0)
printf(" \n This Stack Is Empty !!!");
return -1;
temp=mainarray[top1];
top1--;
return temp;
int pop2()
if(top2>MAX-1)
temp=mainarray[top2];
top2++;
write a pseudocode to input the top speed (in km''s/hours) of 5000 cars output the fastest speed and the slowest speed output the average (mean) speed of all the 5000 cars answers
Searching is the procedure of looking for something: Finding one piece of data that has been stored inside a whole group of data. It is frequently the most time-consuming part of m
to find binary value of an integer
how to learn about time complexity of a particular algorithm
Type of Qualitative Method: Different qualitative methods are suitable for different types of study. Quite often we can combine qualitative and quantitative methods. Many
System defined data types:- These are data types that have been defined by the compiler of any program. The C language contains 4 basic data types:- Int, float, char and doubl
Operation of Algorithm The following sequence of diagrams shows the operation of Dijkstra's Algorithm. The bold vertices show the vertex to which shortest path has been find ou
You have to sort a list L having of a sorted list followed by a few "random" elements. Which sorting methods would be especially suitable for this type of task? Insertion sort
The following DNA sequences are extracted from promoter region of genes which are co-regulated by the same transcription factor (TF). The nucleotide segments capitalized in the giv
Which data structure is required to change infix notation to postfix notation? Stack function is used to change infix notation to postfix notatio n
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd