Category: Data structure

Traversal operation on array

In array traversal operation is the process of visiting each element once. In array, index number is the key factor to support any operation. In array, each element has an unique index number. C program, traversing each element in an array: Explanation of above program: In above program, an array is created. int a[5] = […]

Array in Data Structure

An array is a collection of similar data items stored at contiguous memory locations. For example, Example 01: Array initialization: In above example, int is the type of the array ‘a’ is the name of the array a[6] shows number of elements in array Bracket {}, contains the array elements. Each element in array has […]

Linked List in Data Structure

A linked list is a series of data structures that are linked together. Structure of linked list: Linked list looks like collection of connected nodes. Here the first node is called head. End of the linked list, the last node is marked as NULL. Node connection link is called next link. Each node contains two […]

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) Explanation: […]

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 […]

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 […]

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 […]

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 […]

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 […]

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); } (A) 2550 (B) 2556 (C) 5220 (D) 5520 Ans :- (A) Explanation:- It’s a recursive function. Its gives […]

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 […]

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 […]

Net 14

CBSE NET DECEMBER 2011 PAPER II The number of nodes in a complete binary tree of height h (with roots at level 0) is equal to (A) 20+21+……+2h(B) 20+21+……+2h-1(C) 20+21+……+2h+1(D) 21+……+2h+1 Ans:-A Explanation:-A complete binary tree have 0 or 2 child per parent. So, count the number of nodes in each level, starting with the […]

Net 12

CBSE NET DECEMBER 2007 PAPER II The height of a binary tree with ‘n’ nodes in the worst case is  (A)  0(log n)(B)  O(n)(C)  Ω(n log n)(D)  Ω(n2) Ans:- B Explanation:-Big omega notation is used for representing the average case. Big oh notation is used for representing the worst case. Big oh is a measure […]