1.Write a C program to create stack using 2 queues?
int push(int val)
{
int temp;
if(Q1IsNotFull())
{
while(Q1IsNotEmpty())
{
deleteQ1(&temp);
insertQ2(temp);
}
insertQ1(val);
while(Q2IsNotEmpty())
{
deleteQ2(&temp);
insertQ1(&temp);
}
return(0);
}
else
{
return(-1);
}
}
pop(int *val)
{
if(Q1IsNotEmpty())
{
deleteQ1(&val);
return(0);
}
else
{
return(-1);
}
}
2.Write a C program to delete 3rd node from the last?
3.Write a algorithm to insert a node at nth position?
4.Write a C program to reset the n th bit in a file?
5.Write a C program to swap successive bits of character?
6.Write a C program to swap nibbles of character?
int push(int val)
{
int temp;
if(Q1IsNotFull())
{
while(Q1IsNotEmpty())
{
deleteQ1(&temp);
insertQ2(temp);
}
insertQ1(val);
while(Q2IsNotEmpty())
{
deleteQ2(&temp);
insertQ1(&temp);
}
return(0);
}
else
{
return(-1);
}
}
pop(int *val)
{
if(Q1IsNotEmpty())
{
deleteQ1(&val);
return(0);
}
else
{
return(-1);
}
}
2.Write a C program to delete 3rd node from the last?
3.Write a algorithm to insert a node at nth position?
4.Write a C program to reset the n th bit in a file?
5.Write a C program to swap successive bits of character?
6.Write a C program to swap nibbles of character?
No comments:
Post a Comment
తెలుగులో వ్రాయడానికి http://www.google.com/ime/transliteration/ ఉపయోగించండి.