DS 2
DS 2
DS 2
a. push
b. retrieve
c. pop
d. peek
2. …………………….operation is used to insert an element into the stack
a. push
b. retrieve
c. pop
d. peek
3. Stack is ………………. Data Structure
a. LIFO
b. FIFO
c. LRU
d. LILO
4. ……………….. Operation removes an element from the top of the stack.
a. push
b. retrieve
c. pop
d. peek
5. ………………… operation returns the value of the topmost element of the stack
a. push
b. retrieve
c. pop
d. peek
6. The new element is added at the ………………… position of the stack.
a. Leftmost
b. Rightmost
c. Topmost
d. Bottommost
7. Insert Element from the stack the new element of Top is …………..
a. Top-1
b. Top+1
c. Top
d. Null
8. Stack has ……………. End(s).
a. 1
b. 2
c. 3
d. 4
9. indicating that the stack is full
a. top =stack[MAX]
b. top =stack[MAX-1]
c. top =NULL
d. top =stack[0]
10. If an attempt is made to insert a value in a stack that is already full, an OVERFLOW message is
printed [True / False]
11. indicating that the stack is full
a. top =stack[MAX]
b. top =stack[MAX-1]
c. top =NULL
d. top =stack[0]
12. Remove element from the stack the new element of Top is …………..
a. Top-1
b. Top+1
c. Top
d. Null
13. A ……………… is a FIFO (First-In, First-Out) data structure
a. LinkedList
b. Queue
c. Stack
d. Tree
14. Queue has ……………. End(s).
a. 1
b. 2
c. 3
d. 4
15. ………………… pointer indicates remove element from top of queue
a. Front
b. Rear
c. Top
d. Last
16. ………………… pointer indicates insert element from top of queue
a. Front
b. Rear
c. Top
d. Last
17. …………………indicating that the Queue is full
a. rear =MAX
b. front =Max-1
c. rear =NULL
d. front =stack[0]
18. …………………indicating that the Queue is empty
a. rear =MAX
b. front =Max-1
c. rear =Front=NULL
d. front =stack[0]
19. Circular queue resolve the problem of single queue[T / F].
20. The circular queue will be full only when ……………………….
a. front = 0 and rear = 0
b. front = Max-1 and rear = Max-1
c. front = NULL and rear = Max –1
d. front = 0 and rear = Max –1
21. The circular queue will be not only when ………………………..
a. front != 0 and rear = Max-1
b. front = Max-1 and rear = Max-1
c. front = NULL and rear = Max –1
d. front = 0 and rear = Max –1
22. ………………….. defined as a set of one or more nodes connected by edges
a. LinkedList
b. Queue
c. Stack
d. Tree
23. ……………… is the topmost node in the tree.
a. Front
b. Rear
c. Top
d. root
24. tree is empty when …………….
a. R == NuLL
b. front =Max-1
c. rear =NULL
d. No vertex
25. ………………………… A node that has no children.
a. Path
b. Leaf
c. Ansector
d. Root
26. A sequence of consecutive edges is called a ……………………….
a. Path
b. Leaf
c. Ansector
d. Root
27. ……………………………..is any predecessor node on the path from root to that node.
a. Descendant
b. Leaf
c. Ansector
d. Root
28. …………………. is any successor node on any path from the node to a leaf node.
a. Descendant
b. Leaf
c. Ansector
d. Root
29. The root exists at level ………….
a. 0
b. 1
c. 2
d. 3
30. ……………………equal to the number of children that a node has.
a. Path
b. Leaf
c. Ansector
d. Degree
31. ……………… is the number of edges arriving at that node.
a. In-degree
b. Out-degree
c. Ansector
d. Degree
32. ……………………. are data structures that store elements hierarchically.
a. Forest
b. Queue
c. General Tree
d. Heap
33. A node in a general tree (except the leaf nodes) may have zero or more sub-trees.[T / F].
34. General trees which have 3 sub-trees per node are called……………….
a. Threesome.
b. Ternary trees.
c. Binary trees.
d. Unary trees.
35. …………………………A set of disjoint trees (or forests) is obtained by deleting the root.
a. Forest
b. Queue
c. General Tree
d. Heap
36. Adding a root to a forest become …………………
a. Forest
b. Queue
c. General Tree
d. Heap
37. We can convert a forest into a tree by adding a single node as the root node of the tree.[T / F].
38. if N is any node in T that has left successor S1 and right successor S2, then N is ……………….
of S1 and S2.
a. Sibling
b. Parent
c. Leaf
d. Brother
39. Child level number equal parent level
a. +1
b. -1
c. Divide by 2
d. +2
40. Parent level number equal Child level
a. +1
b. -1
c. Divide by 2
d. +2
41. All nodes that are at the same level and share the same parent are called siblings (brothers).
a. Sibling
b. Parent
c. Leaf
d. Root
42. T1 and T2 has the same Structure but not content Called ……………….
a. Similar
b. Copies
c. Brothers
d. Same
43. T1 and T2 has the same Structure but not content Called ……………….
a. Similar
b. Copies
c. Brothers
d. Same
44. ……………….. a node N is given as the length of the path from the root R to the node N.
a. Path
b. Depth
c. Edge
d. Terminal
45. The height of a binary tree with n nodes is at least ……………….and at most n.
a. log2(n+1)
b. log2(n)
c. 2h-1
d. 2h
46. A binary tree of height h has at least h nodes and at most ………………. nodes.
a. log2(n+1)
b. log2(n)
c. 2h-1
d. 2h
47. A complete binary tree is a binary tree that indicating all nodes appear as far left as possible[T /
F].
r
48. In a complete binary tree Tn, there are exactly n nodes and level r of T can have at most 2 nodes.
49. The maximum size of the array TREE is given as…………………. where h is the height of the
tree.
a. log2(n+1)
b. log2(n)
c. 2h-1
d. 2h
50. If TREE[1] = NULL, then the tree is empty [True / False].
51. ……………….. is a binary tree in which the nodes are arranged in an order.
a. Forest
b. Queue
c. General Tree
d. BST
52. All the nodes in the left sub-tree have a value …………….that of the root node.
a. less than
b. Greater than
c. Equals
d. less than or equal
53. Binary search trees are considered to be efficient data structures especially when compared with
sorted linear arrays and linked lists.
54. ……………………….. is a collection of vertices (nodes) and edges that connect these vertices.
a. Graph
b. Queue
c. General Tree
d. BST
55. ……………….. V(G) represents the set of ……………. while E(G) represents the ……… that
connect these vertices.
a. Vertex
b. Edges
c. Lines
d. Circles
56. Every edge, e = (u, v) that connects nodes u and v, the nodes u and v are the end-points
a. Siblings
b. Adjacent
c. Isolated
d. Distinct
57. ………………….is the total number of edges containing the node u.
a. deg(u)
b. V(u)
c. Edge(u)
58. ……………… each vertex has the same number of neighbours. That is, every node has the same
degree.
a. Regular graph
b. Cycles
c. Complete graph
d. Clique
59. …………………… is a data representation and its associated operations.
a. Data structure
b. Data Abstraction
c. Data Types
d. Type
60. The best data structure for a problem is the one that allows the computer program to solve the
problem efficiently in terms of the required storage and time.
61. ………………….. is a collection of values.
a. Data structure
b. Data Abstraction
c. Data Types
d. Type
62. ……………….. Data type is a type together with a collection of operations to manipulate the
type.
a. Data structure
b. Data Abstraction
c. Data Types
d. Type
63. A …………………is a piece of information or a record whose value is drawn from a type.
a. Data item
b. Data structure
c. Data Abstraction
d. Data Types
64. An ……………….item is a complex data item that contains many data items, probably their
values are drawn from different data types.
a. Aggregate data
b. Data item
c. Data structure
d. Data Abstraction
e. Data Types
65. ……………….. defines a data type in terms of a type and a set of operations on that type.
a. ADT
b. Data structure
c. Data Abstraction
d. Data Types
66. ………………………is the process of hiding implementation details.
a. File structure
b. Encapsulation
c. Data structure
d. Data Abstraction
67. A ……………………is the physical implementation of an ADT.
a. File structure
b. Encapsulation
c. Data structure
d. Data Abstraction
68. …………………… refers to the organization of data on peripheral storage, such as a disk drive
or magnetic tape.
a. File structure
b. Encapsulation
c. Data structure
d. Data Abstraction
69. ……………… is a task to be performed.
a. Algorithm
b. Problem
c. Program
d. Function
70. ………………… is a matching between inputs and outputs.
a. Algorithm
b. Problem
c. Program
d. Function
71. …………………. is a method or a process adopted in order to solve a problem.
a. Algorithm
b. Problem
c. Program
d. Function
72. ………………… is an instance of an algorithm in a certain programming language.
a. Algorithm
b. Problem
c. Program
d. Function
73. ……………… of an algorithm is defined as how efficient this algorithm makes use of the
available computer resources.
a. Efficiency
b. Analysis
c. Accuracy
d. Speed
74. Algorithm analysis measures the algorithm efficiency [True / False].
75. // is used to comment a ……………...statment.
a. Multiple
b. Single
76. ……………… is used to comment multiple statements .
a. /* … */
b. //
c. \\
d. \t
77. int *pnum; define …………….
a. Int value
b. Pointer to integer
c. Refrence to null
d. Null character
78. int arr[] = {1, 2, 3, 4, 5}; arr refers to …………….
a. arr[0]
b. & arr[0]
c. *arr[0]
d. arr+1
79. int *ptr[10] defines ……………..;
a. array of int
b. array of int*
80. int marks[3][5] includes ……………………… elements;
a. 20
b. 15
c. 5
d. 10
81. char str[] = "HELLO"; includes …………………….characters.
a. 5
b. 6
c. 7
d. 20
82. …………….. is stored to signify the end of the character array.
a. Int value
b. Pointer to integer
c. Refrence to null
d. Null character
83. All of these are used to read string except………….
a. scanf()
b. gets()
c. getchar()
d. putchar.
84. Using scanf to read the statement “hi there” stores ……………….in memory.
a. hi there
b. there
c. hi
d. NULL
85. …………… overcomes the drawbacks of the scanf() function.
a. gets()
b. puts()
c. prints
d. strnlen()
86. All of these are used to write string except………….
a. scanf()
b. puts()
c. printf()
d. putchar().
87. The Function ……………… used to find the Length of a String.
a. strlen(s1)
b. strcmp(s1, s2)
c. strrev(s1)
d. strcat(s1, s2).
88. The Function ……………… used to make string “abc” converted to “cba”
a. strlen(s1)
b. strcmp(s1, s2)
c. strrev(s1)
d. strcat(s1, s2).
89. …………………..used to compare two strings s1 ans s2.
a. strlen(s1)
b. strcmp(s1, s2)
c. strrev(s1)
d. strcat(s1, s2).
90. ……………….. used for Appending a String s1 to s2.
a. strcmp(s1, s2)
b. strrev(s1)
c. strcat(s1, s2).
d. strcat(s2, s1).
91. INSERT("XYZXYZ", 3, "AAA")……………………
a. "XYZAAAXYZ"
b. "XYZXYZ"
c. "AAAXYZXYZ"
d. “AAAAAAAAA”
92. INDEX("Welcome to the world of programming", "to") return ……………….
a. 15
b. 8
c. 10
d. 7
};
a. 22
b. 42
c. 0
d. 100
100.struct student stud1; Allocates ………………………….bytes.
a. 22
b. 42
c. 0
d.100
101.………………………..keyword enables the programmer to create a new data type name by using an
existing data type.
a. Union
b. Struct
c. typedef
d. structure
102.The size of a union is equal to the size of its largest member.[True /False]
103.The difference between a structure and a union is that in case of unions information can only be stored in
one member at a time.[True /False]