71.
What is the functionality of the following piece of Java code?
Assume: 'a' is a non empty array of integers, the Stack class creates an array of specified size and provides a top pointer indicating TOS(top of stack), push and pop have normal meaning.
public void some_function(int[] a)
{
	Stack S=new Stack(a.length);
	int[] b=new int[a.length];
	for(int i=0;i<a.length;i++)
	{
		S.push(a[i]);
	}
	for(int i=0;i<a.length;i++)
	{
		b[i]=(int)(S.pop());
	}
	System.out.println("output :");
	for(int i=0;i<b.length;i++)
	{
		System.out.println(b[i]);
	}
}

72.
Select the code snippet which return true if the stack is empty, false otherwise.

public boolean empty()
{
     return q2.isEmpty();
}

public boolean empty() 
{
     return q1.isEmpty() || q2.isEmpty();
}

public boolean empty() 
{
     return q1.isEmpty();
}

public boolean empty() 
{
     return q1.isEmpty() & q2.isEmpty();
}

74.
What happens when you pop from an empty stack while implementing using the Stack ADT in Java?

75.
What would be the asymptotic time complexity to add a node at the end of singly linked list, if the pointer is initially pointing to the head of the list?

77.
Which of these best describes an array?

78.
Given only a single array of size 10 and no other memory is available. Which of the following operation is not feasible to implement (Given only push and pop operation)?

80.
Which of the following is false about a doubly linked list?

Read More Section(Introduction to Data Structures)

Each Section contains maximum 100 MCQs question on Introduction to Data Structures. To get more questions visit other sections.