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++;
Q. How can we free the memory by using Boundary tag method in the context of Dynamic memory management?
Q. Make a BST for the given sequence of numbers. 45,32,90,34,68,72,15,24,30,66,11,50,10 Traverse the BST formed in Pre- order, Inorder and Postorder.
A graph with n vertices will absolutely have a parallel edge or self loop if the total number of edges is greater than n-1
Multidimensional array: Multidimensional arrays can be defined as "arrays of arrays". For example, a bidimensional array can be imagined as a bidimensional table made of elements,
Dequeue (a double ended queue) is an abstract data type alike to queue, where insertion and deletion of elements are allowed at both of the ends. Like a linear queue & a circular q
Prepare a GUI called Hotplate GUI that holds a central panel that draws a rectangular grid that represents Element objects which should be held in a 2-dimensional array. The applic
Q. The reason bubble sort algorithm is inefficient is that it continues execution even after an array is sorted by performing unnecessary comparisons. Therefore, the number of comp
QUESTION (a) Construct a binary tree for the following numbers assuming that a number greater than the node (starting from the root) goes to the left else it goes to the right.
Ask queConsider the following functional dependencies: Applicant_ID -> Applicant_Name Applicant_ID -> Applicant_Address Position_ID -> Positoin_Title Position_ID -> Date_Position_O
infix to revrse polish
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