July 17, 2021 in C and CPP
Show the steps of sorting the following sequence.
b) Show the steps of sorting the following sequence.
25 57 48 37 12 92 86 33
in ascending order using quick sort method.
July 17, 2021 in C and CPP
b) Show the steps of sorting the following sequence.
25 57 48 37 12 92 86 33
in ascending order using quick sort method.
July 17, 2021 in C and CPP
a) Write the algorithm of sorting a set of numbers in descending order using Straight
selection sort. Analyze the algorithm.
July 17, 2021 in C and CPP
b) Write down the iterative algorithm for in-order traversal of a binary tree. What will be the performance analysis of the algorithm?
July 17, 2021 in C and CPP
a) What is a binary tree? Write down different properties of a binary tree.
July 17, 2021 in C and CPP
b) Suppose you are given 2 polynomials. Represent the polynomial in a suitable data structure and write an algorithm/ function to add 2 polynomials.
July 17, 2021 in C and CPP
a) What is a circular list? Write an algorithm for inserting a node at the front.
July 17, 2021 in C and CPP
b) Suppose you have an array of number denoted by num[ ]. Write the iterative and recursive
procedure to find the sum of 1000 elements. What is the space requirement in both the
cases?
July 17, 2021 in C and CPP
a) What do you mean by Performance analysis? What are the other criteria for judging
programs?
July 17, 2021 in C and CPP
A. Degree H. front=0, rear= n-1 O. n+1
B. n log n I. n P. Dangling pointer
C. 1 J. 2 Q. Maximum
D. n2 K. Call by reference R. Call by value
E. 3 L. Free space S. minimum
F. front= rear = 0 M. -1
G. level N. 2e
4.1 During initial creation of heap, root contains __________ element.
4.2 The number of sub-tree of a node is called its __________.
4.3 In hashing, collision and overflow occurs simultaneously when the bucket size is ______.
4.4 In a circular queue, initial condition given is __________.
4.5 If unsorted file contains n numbers line between 100–999, then the number of passes
required to sort the file using radix sort is ________.
4.6 Passing a structure to a function can be performed by _________.
4.7 Suppose in the following union definition
union
{
int a;
char b;
}item;
int requires 2 bytes and char requires 1 byte. Number of bytes allocated to item will be
______.
4.8 If p is a pointer and if free(p) is executed, p will create ______.
4.9 For a connected, undirected graph G with n vertices and e edges, the sum of degrees of
vertices is ______.
4.10Empty queue is represented by the queue in which rear = _____.
July 17, 2021 in C and CPP
Each statement below is either TRUE or FALSE. Choose the most appropriate one
and ENTER in the “tear-off” sheet attached to the question paper, following
instructions therein.
2.1 For a binary search tree with n-nodes, External Path Length = Internal Path Length +
log2n.
2.2 Implementation of priority queue using list is advantageous than that using array.
2.3 In a Circular linked list one can traverse the list backward.
2.4 For an ordered data set, partition exchange sort is better than bubble sort.
2.5 If the hash table is maintained in external storage on a disk, time is the critical factor for hashing.
2.6 Queues can be created by setting up an ordinary contiguous array to hold the items.
2.7 In an expression tree, leaves at the last level are either operands or operators.
2.8 Recursive algorithms always terminate without any condition.
2.9 In-fix expression can be converted to post-fix expression using a data structure called
stack.
2.10Automatic variables can be declared within any block and remain in existence until the
block is terminated.