Showing posts with label Data structure. Show all posts
Showing posts with label Data structure. Show all posts
Net 52
CBSE NET
Q. Convert the following infix expression into its equivalent post fix expression (A + B^ D) / (E – F) + G
(A) ABD^ + EF – / G+
(B) ABD + ^EF – / G+
(C) ABD + ^EF / – G+
(D) ABD^ + EF / – G+
Ans: (A)
Net 51
CBSE NET JUNE 2015 Paper II
Q. The in-order
and pre-order Traversal of binary Tree are dbeafcg and abdecfg respectively.
The post-order Traversal is______.
A)dbefacg
B)debfagc
C)dbefcga
D)debfgca
Ans: (D)
Explanation:
Inorder (Left, Root, Right),Preorder (Root, Left, Right),Postorder (Left, Right, Root)
Given, in-order=dbeafcg, pre-order=abdecfg.
Than, binary tree from in-order and
pre-order become-
Post-order from above binary tree=debfgca
Net 45
CBSE NET DECEMBER 2012 PAPER II
Q. Given an empty stack, after performing push (1), push (2), Pop, push (3), push (4), Pop, Pop, push (5), pop, what is the value of the top of the stack?
(A) 4
(B) 3
(C) 2
(D) 1
Ans: (D)
Explanation: See the image below:
Net 42
CBSE NET JUNE 2012 PAPER II
Q. The post order traversal of a binary tree is DEBFCA. Find out the preorder traversal.
(A) ABFCDE
(B) ADBFEC
(C) ABDECF
(D) None of the above
Ans: (C)
Explanation: DFD – Inorder (Left,Root,Right), Preorder (Root,Left,Right), Postorder (Left,Right,Root). So, POSTORDER to BINARY TREE will like this.
Than BINARY TREE to PREORDER. Where PREORDER (Root, Left, Right) = ABDECF.
Net 41
CBSE NET JUNE 2012 PAPER II
Q. The postfix expression AB + CD - * can be evaluated using a
(A) Stack
(B) Tree
(C) Queue
(D) Linked list
Ans: (A)
Explanation: Stack method is used to convert infix to postfix and postfix to infix. For example, see image, to learn how to convert infix to postfix using stack..
Net 38
CBSE NET
Q. Consider the following transportation problem.
The transportation cost in the initial basic feasible solution of the above transportation problem using Vogel's Approximation method is:
(A) 1450
(B) 1465
(C) 1480
(D) 1520
Ans. (B)
Explanation:
In VAM, Row difference and column difference is calculated.
To calculate row difference, difference of 2 smallest columns are selected, and same process is followed for column difference too. Than to fullfill the demand, value of largest row or columns difference is selected.
Net 37
CBSE NET June 2011
Q. The number of different trees with 8 nodes is
(A) 256
(B) 255
(C) 248
(D) None of the above
Ans :- (C)
Explanation:-
Use formula 2n-n. Here the value of n=8. So, the formula would become 28-8=256-8=248.Net 36
CBSE NET December 2010 PAPER II
Q. A binary tree with 27 nodes has _______ null branches.
(A) 54
(B) 27
(C) 26
(D) None of the above
Ans :- (D)
Explanation:-
A binary tree with n nodes has n+1 null branches. So a binary tree with 27 nodes will have 28 null branches.
Net 35
CBSE NET December 2010 PAPER II
Q. What is the maximum number of nodes in a B-tree of order 10 of depth 3 (root at depth 0) ?
(A) 111
(B) 999
(C) 9999
(D) None of the above
Ans :- (C)
Explanation:-
The formula for calculating the maximum number of nodes in a B-tree of order order n of depth h is
mh+1-1.Here, m=10, h=3. Put in formula than,
mh+1-1.Here, m=10, h=3. Put in formula than,
104-1 which is 10000-1=9999
Net 32
CBSE NET July 2016 PAPER II
Q. What is the value returned by the function f given below when n=100 ?
int f (int n)
{
{
if (n==0) then return n;
else
return n + f(n-2);
}
else
return n + f(n-2);
}
(A) 2550
(B) 2556
(C) 5220
(D) 5520
Ans :- (A)
Explanation:-
It's a recursive function. Its gives output like this, 100+98+96+94+...0. This series of sum shows there is a constant difference of 2. AP gives quick result.
AP = n(nf + nl)/2.
Here n is number of element,nf is first element of series,nl is last element of series. So , sum = 50(0+100)/2 = 2550.
Net 29
CBSE NET July 2016 PAPER II
DATA STRUCTURE
Q. Which of the following logic expressions is incorrect ?
(A) 1⊕0 = 1
(B) 1⊕1⊕1 = 1
(C) 1⊕1⊕0 = 1
(D) 1⊕1 = 0
Ans :- (C)
Explanation:-
In XOR gate, in case of 2 inputs, both the input should be different and in case of 3 inputs the number of 1s in the input should be odd.
Net 27
CBSE NET January 2017 PAPER II
DATA STRUCTURE
Q. The seven elements A, B, C, D, E, F and G are pushed onto a stack in reverse order, i.e., starting from G. The stack is popped five times and each element is inserted into a queue. Two elements are deleted from the queue and pushed back onto the stack. Now, one element is popped from the stack. The popped item is ...................
(A) A
(B) B
(C) F
(D) G
Ans :- (B)
Explanation:-
Push GFEDCBA
A
|
B
|
C
|
D
|
E
|
F
|
G
|
Pop 5 times and pop elements are queued EDCBA
F
|
G
|
2 elements deleted from queue, EDC, and pop in to stack
B
|
A
|
F
|
G
|
1 element pop from stack. That is B
A
|
F
|
G
|
More subjects to read
- Cloud Computing
- Theory of Computation
- Computer Organization and Architecture
- Data Structure
- R Notes
- Software Engineering
- DBMS
- Operating Systems
- Linux
- Discrete Structure
- Computer Network
- Management Information System
- Advanced Computer Architecture
- Information Storage Management
- Network and Web Security
- Distributed System
- PHP Notes
- Web Engineering
- Python Programming
- Java Notes
- Compiler Design
- Principles of Programming Languages

