C - Set 3

1)A complete Binary Tree with 15 nodes contains________edges
(A) 15 (B) 30
(C) 14 (D) 16
Ans: (C)

2)The minimum number of comparisons required to find the largest number from 4
different numbers are
(A) 4 (B) 3
(C) 5 (D) 6
Ans: (B)


3)A complete binary tree with the property that the value of each node is at least as
large as the values of its children is known as
(A) Binary Search Tree. (B) AVL Tree.
(C) Heap. (D) Threaded Binary Tree.
Ans: (C)

4)The number of edges in a simple, n-vertex, complete graph is
(A) n*(n-2). (B) n*(n-1).
(C) n*(n-1)/2. (D) n*(n-1)*(n-2)
Ans: (C)

5)Graphs are represented using
(A) Adjacency tree (B) Adjacency linked list
(C) Adjacency graph (D) Adjacency queue
Ans: (B)

6)The extra key inserted at the end of the array is called a
(A) End Key (B) Stop Key
(C) Sentinel (D) Transposition
Ans: (C)  

7)Which of the following operations is performed more efficiently by doubly linked
list than by singly linked list
(A) Deleting a node whose location is given.
(B) Searching of an unsorted list for a given item.
(C) Inserting a new node after node whose location is given.
(D) Traversing the list to process each node.
Ans: (A)

8)One can determine whether a Binary tree is a Binary Search Tree by traversing it in
(A) Preorder (B) Inorder
(C) Postorder (D) Any of the three orders
Ans: (B)

9)The spanning tree of connected graph with 10 vertices contains
(A) 9 edges (B) 11 edges
(C) 10 edges (D) 9 vertices     
 Ans:A


10)
1- Array of pointers, e.g , int *a[10]; Array of pointers to integer
2-Pointers to an array,e.g , int (*a)[10]; Pointer to an array of into
3-Function returning a pointer,e.g, float *f( ) ; Function returning a pointer to float
4-Pointer to a pointer ,e.g, int **x; Pointer to apointer to int
5-pointer to a data type ,e.g, char *p; pointer to char

11)A sorting technique which uses the binary tree concept such that label of any node is
larger than all the labels in the subtrees, is called
(A) selection sort. (B) insertion sort.
(C) Heap sort. (D) quick sort.
Ans: (C)
A Sorting technique which uses the binary tree concept such that label of any node is
larger than all the, labels in the sub trees, is called Heap sort because heap sort works on
a complete binary tree with the property that the value at any node 'N' of the tree should
be greater than or equal to the value at all its children nodes.

12)A complete binary tree with n leaf nodes has
(A) n+1 nodes (B) 2n-1 nodes
(C) 2n+1 nodes (D) n(n-1)/2 nodes
Ans: (B)

13)A full binary tree with 'n' non-leaf nodes contains
(A) log2 n nodes . (B) n+1 nodes.
(C) 2n nodes. (D) 2n+l nodes.
Ans: (D)




14)Are the expressions *ptr ++ and ++ *ptr same?
Ans: No,*ptr ++ increments pointer and not the value pointed by it. Whereas ++ *ptr
increments the value being pointed to by ptr.

15)Differentiate between a constant pointer and pointer to a constant?
Ans:
const char *p; //pointer to a const character.
char const *p; //pointer to a const character.
char * const p; //const pointer to a char variable.
const char * const p; // const pointer to a const character.
Can we use any name in place of argv and argc as command line arguments ?
Ans: yes we can use any user defined name in place of argc and argv;
SHARE

About df

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment