Computer Science Study Materials for Competitive Exams

Sample Questions, Previous Year Solved Papers, Study Materials For Competitive Examinations Like UGC NET, SET And GATE Computer Science.

Tuesday, 19 September 2017

211.       In a linked list with n nodes, the time taken to insert an element after an element pointed by some pointer is ..............
(A) O(1)
(B) O(log n)
(C) O(n)
(D) O(n 1og n)
Answer: A
212.       The data structure required to evaluate a postfix expression is ...........
(A) Queue
(B) Stack
(C) Array
(D) linked-list
Answer: B
213.       The data structure required to check whether an expression contains balanced parenthesis is ............
(A) Stack
(B) Queue
(C) Tree
(D) Array
Answer: A
214.       The complexity of searching an element from a set of n elements using Binary search algorithm is ............
(A) O(n)
(B) O(log n)
(C) O(n2)
(D) O(n log n)
Answer: B
215.       Which of the sorting techniques has highest best-case runtime complexity?
(A) Quick sort
(B) Selection sort
(C) Insertion sort
(D) Bubble sort
Answer: B
216.       The number of leaf nodes in a complete binary tree of depth d is ...........
(A) 2d
(B) 2d–1+1
(C) 2d+1+1
(D) 2d+1
Answer: A
217.       A circular linked list can be used for ..............
(A) Stack
(B) Queue
(C) Both Stack & Queue
(D) Neither Stack or Queue
Answer: C
218.       What data structure would you mostly likely see in a non-recursive implementation of a recursive algorithm?
(A) Stack
(B) Linked list
(C) Queue
(D) Trees
Answer: A
219.       Which of the following sorting methods would be most suitable for sorting a list which is almost sorted?
(A) Bubble Sort
(B) Insertion Sort
(C) Selection Sort
(D) Quick Sort
Answer: A
220.    A B-tree of minimum degree t can maximum ............... pointers in a node.
(A) t–1
(B) 2t–1
(C) 2t
(D) t
Answer: D

Monday, 18 September 2017

201.       Which of the following is an example of dynamic programming approach?
(A) Fibonacci Series
(B) Tower of Hanoi
(C) Dijkstra’s Shortest Path
(D) All of the above
Answer: D
202.       A queue data-structure can be used for ...............
(A) expression parsing
(B) recursion
(C) resource allocation
(D) all of these
Answer: C
203.       The maximum degree of any vertex in a simple graph with n vertices is:
(A) n–1
(B) n+1
(C) 2n–1
(D) n
Answer: A
204.       The data structure required for Breadth First Traversal on a graph is .............
(A) Queue
(B) Stack
(C) Array
(D) Tree
Answer: A
205.       The quick sort algorithm exploit ................. design technique.
(A) Greedy
(B) Dynamic programming
(C) Divide and Conquer
(D) Backtracking
Answer: C
206.       The number of different directed trees with 3 nodes are:
(A) 2
(B) 3
(C) 4
(D) 5
Answer: B
207.       One can convert a binary tree into its mirror image by traversing it in
(A) in-order
(B) pre-order
(C) post-order
(D) any order
Answer: C
208.       The total number of comparisons required to merge 4 sorted files containing 15, 3, 9 and 8 records into a single sorted file is .............
(A) 66
(B) 39
(C) 15
(D) 3
Ans: ?
209.       Minimum number of moves required to solve a Tower of Hanoi puzzle is ..............
(A) 2^n2
(B) 2n-1
(C) 2n - 1
(D) 2n - 1
Answer: C
210.    What kind of linked list begins with a pointer to the first node, and each node contains a pointer to the next node, and the pointer in the last node points back to the first node?
(A) Circular, singly-linked list.
(B) Circular, doubly-linked list.
(C) Singly-linked list.
(D) Doubly-linked list.
Answer: A

Saturday, 16 September 2017

Waterfall model is a Sequential design process, used in software development processes. In this model, the software development activity is divided into different phases and each phase consists of series of tasks and has different objectives. Since the phases falls from higher level to lower level, like a water fall, It’s named as waterfall model.

In Waterfall model output of one phase becomes input of the next phase. It is mandatory for a phase to be completed before the next phase starts.

Different phases of Waterfall model are as follows:

1. Requirement Analysis: Capture all the requirements, Do the requirements feasibility test.

2. System Design: Create the design, Capture the hardware / software requirements.

3. Implementation: Create the code, Integrate the codes for the next phase,Unit testing of the code.

4. System Testing: Perform all the testing activities to make sure if it works as expected.

5. System Deployment: Deploy the application in the respective environment.

6. System maintenance: Generally, it includes some minor bug fixes that are usually made during this phase. Also the application is always enhanced to incorporate more features, update the environment with the latest features.

Advantages of using Waterfall model

  • Easy to understand and use.
  • Waterfall model works well for smaller projects.
  • Since One phase is done one at a time , it is easy to maintain.
  • Results are well documented.

Disadvantages of using Waterfall model

  • It becomes very difficult to go back to the previous phase and change something.
  • Not a good model for complex and bigger projects.
  • Poor model for long and ongoing projects.
  • Not suitable for the projects where requirements are changed frequently.

Sunday, 10 September 2017

191.       An undirected graph G with n vertices and e edges is represented by adjacency list. What is the time required to generate all the connected components?
(A) O(n)
(B) O(e)
(C) O(e+n)
(D) O(e2)
Answer: C
192.       A stable sorting algorithm:
(A) does not crash.
(B) does not run out of memory.
(C) does not change the sequence of appearance of elements.
(D) does not exists.
Answer: C
193.       Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer?
(A) O(1)
(B) O(log2 n)
(C) O(n)
(D) O(n log2 n)
Answer: A
194.       How many pointers are contained as data members in the nodes of a circular, doubly linked list of integers with five nodes?
(A) 5
(B) 8
(C) 10
(D) 15
Answer: C
195.       The smallest element of an array’s index is called its
(A) lower bound
(B) upper bound
(C) range
(D) extraction
Answer: A
196.       In a circular linked list:
(A) components are all linked together in some sequential manner.
(B) there is no beginning and no end.
(C) components are arranged hierarchically.
(D) forward and backward traversal within the list is permitted.
Answer: B
197.       What is the worst case run-time complexity of binary search algorithm?
(A) Ο(n2)
(B) Ο(nlog n)
(C) Ο(n3)
(D) Ο(n)
Answer: D
198.       A graph with n vertices will definitely have a parallel edge or self loop of the total number of edges are ..............
(A) more than n
(B) more than n+1
(C) more than (n+1)/2
(D) more than n(n-1)/2
Answer: D
199.       Interpolation search is an improved variant of binary search. It is necessary for this search algorithm to work that:
(A) data collection should be in sorted form and equally distributed.
(B) data collection should be in sorted form and but not equally distributed.
(C) data collection should be equally distributed but not sorted.
(D) None of these.
Answer: A
200.    The minimum number of multiplications and additions required to evaluate the polynomial
P = 4x3+3x2-15x+45 is
(A) 6 & 3
(B) 4 & 2
(C) 3 & 3
(D) 8 & 3
Answer: C

Saturday, 9 September 2017

181.       The worst case complexity of binary search matches with ...............
(A) interpolation search
(B) linear search
(C) merge sort
(D) none of the above
Answer: B
182.       A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is known as
(A) full binary tree
(B) AVL tree
(C) threaded tree
(D) complete binary tree
Answer: A
183.       A linear list of elements in which deletion can be done from one end (front) and insertion
can take place only at the other end (rear) is known as a .................
(A) Queue
(B) Stack
(C) Tree
(D) Linked list
Answer: A
184.       What is the postfix form of the following prefix expression -A/B*C$DE ?
(A) ABCDE$*/-
(B) A-BCDE$*/-
(C) ABC$ED*/-
(D) A-BCDE$*/
Answer: A
185.       The following formula will produce:
Fn = Fn-1 + Fn-2
(A) Armstrong Number
(B) Fibonacci Series
(C) Euler Number
(D) Prime Number
Answer: B
186.       All possible spanning trees of graph G:
(A) have same number of edges and vertices.
(B) have same number of edges and but not vertices.
(C) have same number of vertices but not edges.
(D) depends upon algorithm being used.
Answer: A
187.       A full binary tree with n leaves contains .............
(A) n nodes
(B) log n2 nodes
(C) 2n –1 nodes
(D) 2n nodes
Answer: C
188.       The Θ notation in asymptotic evaluation represents ...........
(A) Base case
(B) Average case
(C) Worst case
(D) NULL case
Answer: B
189.       A sort which relatively passes through a list to exchange the first element with any element less than it and then repeats with a new first element is called ................
(A) Insertion sort
(B) Selection sort
(C) Heap sort
(D) Quick sort
Answer: D
190.    Which of the following sorting algorithms does not have a worst case running time of O(n2) ?
(A) Insertion sort
(B) Merge sort
(C) Quick sort
(D) Bubble sort
Answer: B

Friday, 8 September 2017

171.       Project scheduling is an example of ................
(A) Greedy programming
(B) Dynamic programming
(C) Divide and conquer
(D) None of the above.
Answer: B
172.       Minimum number of queues required for priority queue implementation?
(A) 5
(B) 4
(C) 3
(D) 2
Answer: D
173.       From a complete graph, by removing maximum ................ edges, we can construct a spanning tree.
(A) e-n+1
(B) n-e+1
(C) n+e-1
(D) e-n-1
Answer: A
174.       Which of these algorithmic approaches tries to achieve localized optimum solution?
(A) Greedy approach
(B) Divide and conquer approach
(C) Dynamic approach
(D) All of the above
Answer: A
175.       In worst case Quick Sort has order ..............
(A) O(n log n)
(B) O(n2/2)
(C) O(log n)
(D) O(n2/4)
Answer: B

176.       To partition unsorted list a pivot element is used in ...............
(A) Merge Sort
(B) Quick Sort
(C) Insertion Sort
(D) Selection Sort
Answer: B
177.       What is the worst case time complexity of linear search algorithm?
(A) Ο(1)
(B) Ο(n)
(C) Ο(log n)
(D) Ο(n2)
Answer: D
Explanation
Linear search scans sequentially to find the target value. The best case is Ο(1) and average and worst case is Ο(n). Worst case is when data is not in the list, and it has to scan all n elements.
178.       A full binary tree with 2n+1 nodes contain ................
(A) n leaf nodes
(B) n non-leaf nodes
(C) n-1 leaf nodes
(D) n-1 non-leaf nodes
Answer: B
179.       Which of the following statements about stacks is incorrect?
(A) Stacks can be implemented using linked lists.
(B) Stacks are first-in, first-out (FIFO) data structures.
(C) New nodes can only be added to the top of the stack.
(D) The last node (at the bottom) of a stack has a null (0) link.
Answer: B
180.    If a node in a BST has two children, then its in-order predecessor has .............
(A) no left child
(B) no right child
(C) two children
(D) no child
Answer: B

Pages  17   18   19   20   21   22