Design and Analysis of Algorithms

An algorithm is a set of steps of operations to solve a problem performing calculation, data processing, and automated reasoning tasks. An algorithm is an efficient method that can be expressed within finite amount of time and space. An algorithm is the best way to represent the solution of a particular problem in a very simple and efficient way. If we have an algorithm for a specific problem, then we can implement it in any programming language, meaning that the algorithm is independent from any programming languages.

There are ______steps to solve the problem

______is the first step in solving the problem

Following is true for understanding of a problem

The six-step solution for the problem can be applied to


I. Problems with Algorithmic Solution


II. Problems with Heuristic Solution

______ solution requires reasoning built on knowledge and experience

While solving the problem with computer the most difficult step is __________.

The correctness and appropriateness of ___________solution can be checked very easily.

The branch of computer that deals with heuristic types of problem is called _________________.

Artificial Intelligence makes use of following prominently

The true and false values represent __________.

Naming convention for variable is followed in company because ____________.

Following operator distinguishes equation from expression

Following are called logical operators

The hierarchy of operations is denoted as _____________.


I. +, -


II. Power


III. *, /


IV. \, MOD

22. An employee came in to work and clocked in at MorningIn, clocked out at NoonOut1 for lunch, clocked back in at NoonIn, and clocked out to home at NoonOut2. Set up equation to calculate the number of hours worked for the day.

The hierarchy of operations is denoted as _____________.


I. +, -


II. Power


III. *, /


IV. \, MOD

Evaluate 5*(x+y)-4*y/(z+6) where x = 2, y = 3, and z = 6

Evaluate a-2>b where a=6, b = 8

Evaluate for a = 5, b = 4, c = 3, d = 12 for the equation E = a*b+d/c

Evaluate for the equation e = 5*a\d*(b+1) where a = 5, b = 4, c = 3, d = 12

Evaluate for the following A = TRUE, B = FALSE, C = FALSE


i. R = NOT ( A OR B ) AND NOT (B OR C)


ii. R = B AND NOT ( A OR C ) OR NOT (B AND C)

A large department store has its own charge card. The policy for a customer to charge an item is that the customer must have a valid charge card and either a balance of less than Rs.500 or a charge of less than Rs.50.

The PAC stands for

The IPO stands for

In interactivity chart the darkened circle indicates _______________.

In interactivity chart the diamond indicates _______________.

The interactivity chart is also known as __________________.

The difference between /, \ and MOD operator is

The help menus or user manuals are the part of ______________.

The main measure for efficiency algorithm are-

What does the algorithmic analysis count?

Examples of O(1) algorithms are______________.

Examples of O(n2) algorithms are______________.

The complexity of three algorithms is given as: O(n), O(n2) and O(n3). Which should execute slowest for large value of n?

There are four algorithms A1, A2, A3, A4 to solve the given problem with the order log(n), nlog(n), log(log(n))n/log(n), Which is the best algorithm.

Express the formula (n-1)*(n-5) in terms of big Oh notation

The time complexity of binary search is________.

The time complexity of linear search is________.

In quick sort, the number of partitions into which the file of size n is divided by a selected record is

A sort technique is said to be stable when the original relative order of records with equal keys are retained after sorting.

The three factors contributing to the sort efficiency considerations are the efficiency in coding, machine run time and the space requirement for running the procedure.

How many passes are required to sort a file of size n by bubble sort method?

How many number of comparisons are required in insertion sort to sort a file if the file is sorted in reverse order?

How many number of comparisons are required in insertion sort to sort a file if the file is already sorted?

Which of the following sorting procedures is the slowest?

The worst-case time complexity of Quick Sort is________.

The worst-case time complexity of Bubble Sort is________.

The worst-case time complexity of Selection Exchange Sort is________.

The worst-case time complexity of Merge Sort is________.

The algorithm like Quick sort does not require extra memory for carrying out the sorting procedure. This technique is called __________.

Two main measures for the efficiency of an algorithm are

The space factor when determining the efficiency of algorithm is measured by

The time factor when determining the efficiency of algorithm is measured by

A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is

Which of the following case does not exist in complexity theory?

The concept of order Big O is important because

The recurrence relation capturing the optimal execution time of the Towers of Hanoi problem with n discs is

Which of the following sorting methods would be most suitable for sorting a list which is almost sorted?

Suppose we are sorting an array of eight integers using some quadratic sorting algorithm. After four iterations of the algorithm’s main loop, the array elements are ordered as shown here:


2 4 5 7 8 1 3 6

The running time of insertion sort is

A sort which compares adjacent elements in a list and switches where necessary is ____.

The correct order of the efficiency of the following sorting algorithms according to their overall running time comparison is

Given f(n) = log2n, g(n) = √n which function is asymptotically faster

A sort which iteratively 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

The number of swapping’s needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order, using bubble sort is

The way a card game player arranges his cards as he picks them one by one can be compared to

Which among the following is the best when the list is already sorted?

As part of the maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be

In quick sort, the number of partitions into which the file of size n is divided by a selected record is

The total number of comparisons made in quick sort for sorting a file of size n, is

Quick sort efficiency can be improved by adopting

For the improvement of efficiency of quick sort the pivot can be

Quick sort is the fastest available method of sorting because of

Straight selection sort is basically a method of repeated

Number of selections required to sort a file of size N by straight selection requires

For sorting a file of size n by straight selection sort, the number of comparisons made in the first pass is

Heap is defined to be a

In a Max heap the largest key is at

In heap sort the input is arranged in the form of a

Heap sort is found to be very efficient

Suppose we need to sort a list of employee records in ascending order, using the social security number (a 9-digit number) as the key (i.e., sort the records by social security number). If we need to guarantee that the running time will be no worse than n log n, which sorting methods could we use?

Consider the following function f:


int f(int n)


{


int s = 0;


while(n > 1)


{


n = n/2;


s++;


}


return s;


}


What is the asymptotic complexity in terms of n? (Pick the smallest correct answer)

The most important reason for including a destructor in a class is:

One of these code fragments calls the copy constructor for class A. Which one? (Assume that doSomething is a void function with a parameter of the appropriate type.)

What is the asymptotic runtime for traversing all nodes in a binary search tree with n nodes and printing them in order?

Consider a class List that implements an unordered list. Suppose it has as its representation a dynamically expanding (resizable) array. Which of these operations might need to delete some dynamically allocated storage to avoid a memory leak?


I. Default Constructor


II. Copy Constructor


III. Destructor


IV. Assignment operator

What is the postfix representation of this expression?


(12 – a) * (b + 9) / (d * 4)

Assuming that the hash function for a table works well, and the size of the hash table is reasonably large compared to the number of items in the table, the expected (average) time needed to find an item in a hash table containing n items is

T (n) = 4T (n/2) + n then T (n) =
Which of the following properties are necessary for an Algorithm?
which of the following technique is not using for solve a 0-1knapsack problem
n! =
T (n) = 8T (n/2) + n2, T (1) = 1 then T (n) =
T (n) = 3T (n/4) + n then T (n) =
T (n) = 2T (n/2) + cn then T (n) =
T (n) = 9T (n/3) + n then T (n) =
Which of the following case does not exist in complexity theory?
The Worst case occur in linear search algorithm when
The complexity of Fibonacci series is
The worst case occur in quick sort when
An algorithm in which we divide the problem into subproblem and then we combine the subsolutions to form solution to the original problem is known as:

Be the first to comment

Leave a Reply