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

Question

Define Data Structure.

List the properties of algorithm.

Illustrate Pseudocode.

List the different operations that can be performed on data structures.

Define ADT.

Give the diagrammatical representation for notion of algorithm.

Define Theta notation.

Give two examples of algorithms requiring Best, Worst and Average case analysis

Write the recursive algorithm to compute nth Fibonacci number.

Write a recursive algorithm to find the number of bits in the binary representation of a number n.

Fill in the blanks: a) 10n^3 - 5n^2 Î _____(n^4) b) n log n + 5n^2 Î W(_____).

Differentiate linear and non-linear data structures.

Is it advisable to measure the running time of an algorithm in terms of time units? Justify

Illustrate Time-Space tradeoff.

Outline two situations where an approximate answer is preferred for a problem.

Compute the GCD of 56 and 20 using an efficient approach.

Compare the growth rates of the functions log n and n^2 using L'Hopital's rule

Identify the input size metric and basic operation count for Sorting algorithms.

Determine the efficiency class for the matrix addition algorithm and justify.

Best Case analysis is more useful than Worst case analysis. True / False. Justify

Classify data structures. Elaborate on various types of linear data structures and state two applications for each.

Order the following functions in increasing order of growth and give the tight upper bound for each functio
f1(n)=n^3, f2(n)=nlog2n, f3(n)=log4n, f4(n)=n, f5(n)=n^2, f6(n)=√n, f7(n)=22n

Write an algorithm to check if a matrix is symmetric and determine its efficiency class.

Write the algorithm for finding all prime numbers untill a given number and illustrate its working.

Describe how the L'Hopital's rule can be used to compare the growth rates of functions with examples.

Identify the suitable data structure for each of the following scenarios and justify:
a. Railway reservation system b. Social network representation c. Reverse a string d. File directory

Outline various efficiency classes and state a possible scenario for each class.
Prove that if If t1(n) Î O(g1(n)) and t2(n) Î O(g2(n)) then t1(n) + t2(n) Î O(max{g1(n), g2(n)}).

Elaborate on the process of Algorithmic problem solving with flow diagram.

Illustrate various algorithms to find GCD of two numbers and also find GCD (128, 14).

Describe Asymptotic notations used in algorithm analysis with necessary graphs and examples.

Write down the sequential search algorithm and analyze its worst-case, best-case and average-case efficiencies.

Compare array and linked list representations of list.

Write an algorithm for searching an element in an array.

State the time complexity of insert and delete operations in an Array.

Define List and compare it with Set.

Compare Singly Linked List and Doubly Linked list representations.

Write the condition for empty list in the case of: a. Singly Linked List b. Circularly linked list

Give the time complexity of search and traversal operations in a Singly Linked List.

Sketch Multi-list structure for Student Course registration details.

Represent the polynomial 3x^5 – 56x + 17 using linked list.

Write an algorithm to print the values in a singly linked list.

Write an algorithm to count the nodes in a Singly linked list.

Write an algorithm to insert an element into the beginning of a Circularly Linked List.

Write an algorithm to search for a value in a Circularly linked list.

Apply radix sort on the following set of numbers: 46, 89, 23, 72, 11, 90, 13

Outline the application of doubly linked lists.

The access time for any element in a single dimensional array is O(1). Justify.

Frame an addressing function to access the element at position [i, j] of a two dimensional array stored in row-major
order.

Given two singly linked lists, construct the resultant linked list formed by performing union operation.

Write an algorithm to print alternate values stored in a Doubly linked list.

Write an algorithm to convert a linked list of size MAX into an array.

Write algorithms for insert and delete operations on Array based list and explain with examples.

Elucidate on all possibilities of inserting and deleting an element into a sorted Singly linked list with example and
algorithms.
Differentiate between singly linked list and circularly linked list. Devise algorithms for search and delete operations i
a Circularly Linked List.

Illustrate the usage of linked lists for representing polynomials. Also explain the addition of polynomials with exampl
and algorithm.

Write an algorithm for inserting an element in a list using static memory allocation.

Elaborate on any two applications of linked lists with examples.

Devise algorithms for insertion of a node in a Circularly Linked List at different position.

Write algorithms for deleting an element from doubly linked list and explain with examples.

Write an algorithm to print the values stored in each node of a Doubly linked list in reverse order.

Show how to Swap two values in a singly linked list by adjusting the pointer without using temporary variables.

Illustrate how to print the kth node in a singly linked list.

Show how to detect a cycle in a singly linked list.

Define Stack ADT.

State the operations on stack and give the diagrammatic representation.

List out any two real world applications of Stacks.

Define infix and postfix expression.

Write a routine to check for Empty condition of Linked list-based stack.

Evaluate the following postfix expression using stack : 2 3 + 4 5 + *

Outline the disadvantages of array implementation of stack.

Identify the return points for the following functions:


void main() void A() void B()
{ { {
1: 1: 1:
2: A() 2: B() 2:
3: 3: 3: return
4: 4:return }
} }

Write an algorithm to insert a value into a Stack whose size is initially not known.

Show the result of the following sequence of operations on a Array based Stack. Push A, Push B, Pop B, Push C.

Write algorithms to implement Stack ADT using linked list to perform 1.Push 2. Pop 3. Display operations. Show th
result of the following operations on a linked-list Stack: Push 11, 22, 33, and 44. DisplayTop element. Pop once.
Display the Top element.

Write the algorithm for converting an infix expression into postfix form and apply the algorithm to convert the
following expressions:
i)x + y – a * (b + d *( c / e ^ p - q)-s) *+z ii) 3*2(4+5+7)/9
Write algorithms to implement stack of size N using an array. The elements in the stack are to be integers. The
operations to be supported are PUSH, POP and DISPLAY. Take into account the exceptions of stack overflow and stac
underflow.

Develop an algorithm to check whether an expression has balanced parenthesis using Stack. Illustrate the working of
the algorithm for the following input: { [ ( ) ] } }

Outline the algorithm for evaluating a postfix expression using stack with an example.

Write a recursive procedure for Factorial calculation and illustrate the usage of Stack in the function call and return
mechanism.
Mark
2

8
8

15

15

15

15

15

15
15

15

15

15
8

You might also like