Q161
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
210
Questions
9/11
Page
Pick an option on a question to see the right answer and solution.
Q161
Open questionSelect an option to see the answer and solution.
Q162
Open questionSelect an option to see the answer and solution.
Q163
Open questionSelect an option to see the answer and solution.
Q164
Open questionSelect an option to see the answer and solution.
Q165
Open questionSelect an option to see the answer and solution.
Q166
Open questionSelect an option to see the answer and solution.
Q167
Open questionSelect an option to see the answer and solution.
Q168
Open questionSelect an option to see the answer and solution.
Q169
Open questionSelect an option to see the answer and solution.
Q170
Open questionSelect an option to see the answer and solution.
Q171
Open questionstruct node
{
int value;
struct node *next;
};
void rearrange(struct node *list)
{
struct node *p, * q;
int temp;
if ((!list) || !list->next)
return;
p = list;
q = list->next;
while(q)
{
temp = p->value;
p->value = q->value;
q->value = temp;
p = q->next;
q = p?p->next:0;
}
}Select an option to see the answer and solution.
Q172
Open questionstruct node
{
int data;
struct node * next;
}
typedef struct node NODE;
NODE *ptr;Select an option to see the answer and solution.
Q173
Open questionpublic Object some_func()throws emptyStackException
{
if(isEmpty())
throw new emptyStackException("underflow");
return first.getEle();
}Select an option to see the answer and solution.
Q174
Open questionpublic class Stack
{
protected static final int CAPACITY = 100;
protected int size,top = -1;
protected Object stk[];
public Stack()
{
stk = new Object[CAPACITY];
}
public void push(Object item)
{
if(size_of_stack==size)
{
System.out.println("Stack overflow");
return;
}
else
{
top++;
stk[top]=item;
}
}
public Object pop()
{
if(top<0)
{
return -999;
}
else
{
Object ele=stk[top];
top--;
size_of_stack--;
return ele;
}
}
}
public class StackDemo
{
public static void main(String args[])
{
Stack myStack = new Stack();
myStack.push(10);
Object element1 = myStack.pop();
Object element2 = myStack.pop();
System.out.println(element2);
}
}Select an option to see the answer and solution.
Q175
Open questionSelect an option to see the answer and solution.
Q176
Open questionpublic int function()
{
Node temp = tail.getPrev();
tail.setPrev(temp.getPrev());
temp.getPrev().setNext(tail);
size--;
return temp.getItem();
}Select an option to see the answer and solution.
Q177
Open questionOptions are not available for this question.
Select an option to see the answer and solution.
Q178
Open questionSelect an option to see the answer and solution.
Q179
Open questionclass Node
{
protected Node next;
protected Object ele;
Node()
{
this(null,null);
}
Node(Object e,Node n)
{
ele=e;
next=n;
}
public void setNext(Node n)
{
next=n;
}
public void setEle(Object e)
{
ele=e;
}
public Node getNext()
{
return next;
}
public Object getEle()
{
return ele;
}
}
class Stack
{
Node first;
int size=0;
Stack()
{
first=null;
}
}Options are not available for this question.
Select an option to see the answer and solution.
Q180
Open questionSelect an option to see the answer and solution.