Dsa Ccet II _coxco-Qb Fnal

You might also like

Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 9

Question

List out the various applications of Queues.

State the operations on queue and give the diagrammatic representation.

Write an algorithm to display the contents of queue.

Circular queue is better than standard linear queue- Justify

Develop an algorithm for deleting an element in a double ended queue.

Write down the function to insert an element into a queue, in which the queue is implemented as an array.
A standard circular Queue 'q' implemented whose size is 11 from 0 to 10. The front & rear pointers start to point a
q[2]. The ninth element be added at which position.
Write a routine to check whether the queue is full or empty, queue size is initially unknown

Illustrate the difference between queue and stack with an example.

For railway reservation the queue data structure is preferred –Justify.

Write an ADT to implement Linear queue of size N using linked list. The elements in the queue are to be integers
The operations to be supported are enqueue and dequeue. Take into account the exception of queue is full and
empty.

A circular queue has a size of 5 and has 3 elements 10,20 and 40 where F=2 and R=4. After inserting 50 and 60,
what is the value of F and R. Trying to insert 30 at this stage what happens? Delete 2 elements from the queue and
insert 70, 80 & 90. Show the sequence of steps with necessary diagrams with the value of F & R. Write the
enqueue and dequeue algorithms.

Write a function called ‘enqueue’ that takes two parameters: an integer variable and a queue into which it would
insert this element and returns a 1 or a 0 to show success of addition or failure

Write C program to implement process scheduling using circular queue.

Write an algorithm for implementing Enqueue operation usinh linked list and explain with example.

Illustrate the enqueue and dequeue operations on double ended queue with neat sketch, example and explanation.
Define Hashing.
State the applications of Hashing.
List the steps in Rehashing.
State the advantages and disadvantages of linear probing.
Define Collision and state how it can be handled.
State the goal of Empirical Analysis.
List the methods used to solve recurrence relations and compare them.
Draw the general recursion tree for Towers of Hanoi problem.
Outline the characteristics of a good hash function.
Compare Separate Chaining and Open Addressing.
Compare various collision resolution techniques used in open addressing.
What is load factor? Prescribe suitable load factors for the success of open addressing and separate chaining.
Identify the situations leading to Rehashing.
Write the algorithm for generating pseudo-random numbers using linear congruential method.
Compare Mathematical Analysis and Empirical analysis.
Solve the recurrence x(n) = x(n-1)+1 with initial condition x(0)=0.
The input size n is plotted against the count of the basic operation. The resultant graph is concave. Infer th
efficiency class of the underlying algorithm and justify.
Identify the techniques used to predict algorithm’s performance for inputs not in the sample.
Frame the recurrence relation for the recursive algorithm for Factorial computation.
Write a recursive algorithm to find the number of bits in the binary representation of a number n.
Explain the hashing methods commonly used for numeric data.
Write a non-recursive algorithm to check if a matrix is symmetric and analyze its time complexity.
Illustrate any two hash functions applied on alphanumeric inputs with example and algorithms.
Store the keys 6, 15, 23, 24, 13, 4 in a hash table of size 7, Identify the right point for applying rehashing and re-
hash all the values
Store the keys 0, 1, 8, 27, 64, 125, 216, 345, 517, 725 in a separate chaining hash table of size 10 and calculate the
load factor.
Write a non-recursive algorithm to find the difference between the maximum and minimum elements in an array
and analyze its time complexity.
Write an algorithm for Matrix multiplication and analyze its time complexity.
Write an algorithm to calculate 2^n using recursion (2^n = 2^n-1 + 2^n-1). Derive its time complexity.
Explain the steps used in empirical analysis of algorithms with an example algorithm.
Write algorithms for the insert and delete operations on a Separate Chaining hash table and explain with an
example.
Outline the working of various Collision Resolution strategies used in Open Addressing. Store the keys: 7, 18, 2, 3
14, 25, 1, 11, 12 in a Hash Table of size 11 using linear probing, quadratic probing and double hashing.
Write a recursive algorithm for solving the Towers of Hanoi problem and analyze its time complexity. Sketch the
working of the algorithm for n=4.
State the advantages and disadvantages of the Brute Force approach.
List the steps in solving Combinatorial problems using Exhaustive Search.
Give the time complexity for solving the Assignment problem and Knapsack problem using Exhaustive Searc
approach.
Mention any four applications of String Matching algorithms.
State the Best, Worst and Average case time complexity of Linear Search algorithm.
Name two sorting algorithms which follow the Divide and Conquer approach.
Give the worst case and average case complexity of Quick Sort.
Frame the general recurrence relation for the Divide and Conquer approach.
Illustrate the working of Exhaustive Search approach for the Job Assignment Problem with an example.
Frame the algorithm for String matching using the Brute force approach.
Compare linear search and binary search.
Sort the given set of numbers using Bubble Sort: 23, 17, 90, 6, 55, 33.
Construct a schematic representation of the working of Divide and Conquer algorithms.
Compare various pivot selection strategies in Quick Sort.
Give sample inputs for Best and Worst case performance of Binary Search algorithm.
Propose ways to reduce the search space size while solving the Travelling Salesperson problem using Exhaustiv
Search.
Sort the given numbers using Quick Sort: 12, 5, 80, 12, 3, 35
Determine the number of comparisons made by the Brute Force approach for locating the pattern “ABC” in th
text “ABACADABCD”.
Given that the recurrence relation for an algorithm is T(n) = 4T(n/2) + n 3, determine the time complexity usin
Master’s Theorem.
Propose an efficient method for computing a^n using Divide and Conquer approach.
Elaborate on the working of Exhaustive Search approach for Knapsack problem with detailed example.
Explain the working of Brute Force approach for String matching. Write the algorithm and apply it on the tex
“ababcdabbabababad” and pattern “abababa”.
Write the algorithm for linear Search and explain its working with an example.
Write the iterative algorithm for binary search and explain its working for successful and unsuccessful search.
Elaborate on the working of Exhaustive Search approach for Travelling Salesperson problem with detaile
example.
Elaborate on the working of Exhaustive Search approach for Assignment problem with detailed example.
Analyze the best and worst case time complexity of the linear search algorithm with suitable example.
Write an algorithm for Bubble Sort and explain its working with an example. Analyze its time complexity
Develop an efficient version by reducing the number of passes.
Elaborate on the working of Exhaustive Search approach for (i)Knapsack problem and (ii) Assignment problem
with detailed example.
Write the recursive algorithm for Binary Search and explain its working with an example. Analyze the best an
worst case time complexity of the algorithm.
Write the MergeSort algorithm, analyze its time complexity and explain its working on the input: 23, 9, 12
78, 90, 6, 55, 1.
Write the algorithm for Quick Sort and analyze its time complexity and sort the given numbers : 11, 24, 6, 9
3, 56, 9, 21, 78.
Mark
2

15

15

7
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
7
7
7
7

8
8
8
15
15

15

15
2
2
2

2
2
2
2
2
2
2
2
2
2
2
2
2

2
2
2

2
7
7
7
7
8
8
8
8

15

15

15

15

You might also like