Concept note Given infix expression A * (B + C) / D To convert the infix expression in to prefix notation, follow these steps ((A * (B + C))/D) ((A * (+ BC)) / D) ((* A(+ BC))/ D) /(* A( + BC))D /* A + BCD So, the prefix expression is /*A + BCD.
Concept note B-tree is a self-balancing tree data structure that maintains sorted data and allows searches, sequential access, insertions and deletions in logarithmic time. A B-tree is of order p and consists of n keys. The maximum of the B-tree is
+
n
1
=
h log max
p/2
2
The minimum height of the B-tree is
(
)
=
+
−
h log n
1
1
min p
Concept note To determine the location of the key 11 in the hash table, apply the given hash function and resolve collisions using linear probing. Given hash function
f(key) = key mod 7
step-by-step insertion of keys- Index Key
0
98
1
56
2
37
3
38
4
72
5
11
6
48
Final Hash Table-
Insert 37:
37 mod 7 = 2
key 37 is placed at index 2 Insert 38:
38 mod 7 = 3
key 38 is placed at index 3 Insert 72:
72 mod 7 = 2
Index 2 is occupied (collision), So we use linear probing to find the next available index: check index 3 → Occupied check index 4 → Free key 72 is placed at index 4 Insert 48:
48 mod 7 = 6
key 48 is placed at index 6 Insert 98:
98 mod 7 = 0
key 98 is placed at index 0. Insert 11:
11 mod 7 = 4
Index 4 is occupied, so we use linear probing. Check index 5 → free key 11 is placed at index 5. Insert 56:
56 mod 7 = 0
index 0 is occupied, so we use linear probing check index 1 → free key 56 is placed at index 1. So, the location of key 11 is index 5.
Concept note As list concatenation requires traversing at least one list to the end. So singly linked list and doubly linked list requires O(n) time complexity whereas circular doubly linked list required O (1) time.
Concept note The floyd - Warshall algorithm (also known as floyd's algorithm) is an algorithm for finding shortest paths in a directed weighted graph with positive or negative (or zero) edge weights (but with no negative cycles). It is used to solve the all - pairs shortest path problem.
Concept note Heapsort is a comparison - based sorting algorithm which can be thought of as implementation of selection sort using the right data structure. In heap sort, we use binary heap so that we can quickly find and move the max element in O (log n) instead of O (n) and hence achieve the O (n log n) time complexity.
Correct answer: Left subtree is always visited before right subtree
Concept note In all three types of binary tree traversals (inorder, preorder and post order) the left subtree is always visited before the right subtree, irrespective of when the root node is visited. Preorder traversal - Root → Left subtree → Right (i) subtree (ii) Inorder traversal - Left subtree → Root → Right subtree (iii) Post order traversal - Left subtree → Right subtree →Root In each case, the left subtree is consistently visited before the right subtree.
Concept note In Binary Search, we first compare the given element with middle of the array. If given element matches with middle element, then we return middle index otherwise, we either recur for left half of array or right half of array. So recurrence is T (n) = T (n/2) + O (1) and T (1) = T (0) = O (1).
Concept note Inorder traversal lists the nodes of a binary search tree in ascending order. This traversal technique visits the nodes in the following order. (i) Left subtree (ii) Root (iii) Right subtree As a result, inorder traversal lists the nodes of a binary search tree in increasing order.
Concept note The question involves a has table of length 10 using open addressing and linear probing with the hash function h(k) = kmod 10. We need to determine the correct sequence of insertion based on the given table. Option (c) : 46, 34, 42, 23, 52, 33
• Insert 46 → 46 mod 10 = 6
placed at index 6.
• Insert 34 → 34 mod 10 = 4
placed at index 4.
• Insert 42 → 42 mod 10 = 2
placed at index 2.
• Insert 23 → 23 mod 10 = 3
placed at index 3.
• Insert 52 → 52 mod 10 = 2
collision → next available index is 5.
• Insert 33 → 33 mod 10 = 3
collision → next available index is 7. Matches the given table, So the possible orders of insertion is 46, 34, 42, 23, 52, 33.
Concept note C was primarily developed as a system programming language, particularly for writing operating systems and low level applications. It was created by Dennis Ritchies in the 1970s for the development of the UNIX operating system.
Concept note The minimum number of temporary variables needed to swap the contents of two variables is 1. Swapping the values of two variables generally means exchanging the contents of one variable with another.
Concept note In given program fragment, the expression
'a++ + ++b' is evaluated as a+(++b) due to the
precedence of the increment operator ++.
The first '++' is the pre-increment operator applied to b,
so b becomes 3. Then, the expression becomes a + 3, where a is 5. Thus, the output is 5 + 3 = 8 So, the correct answer is option (b) prints 8.
Concept note Analyze the given C program segment. • Initially, i = 6720 and j = 4 • The while loop will continue as long as (i%j) = = 0, meaning i is divisible by j. First iteration (j = 4):
• i % 4 = = 6720 % 4 = = 0 (true),
so the loop executes.
• Now, i = i/j = 6720/4 = 1680
• j = j + 1 = 4 + 1 = 5
Sixth iteration (j = 9):
• i % 9 = = 1 % 9 = = 0 (false)
So the loop terminates. Hence, the loop terminates when j = 9, so the value of j at termination is 9.
Concept note The loop continues while j ≤ n. Each iteration of the loop multiplies j by 2. After k iterations: The value of j after k iterations can be represented as j = 2k. To find the number of interations k when the loop stops, we need to solve: 2k ≤ n Taking the logarithm (base2) on both sides k ≤ log2(n) Since k must be an integar, the maximum number of complete iterations is
+
log n
1
k =
2
Thus, the number of comparisons made in the execution
+
log n
1
of the loop is
2
Concept note The variable a is declared as an int and initialiazed with the value 'A'. In C, characters are represented by their ASCII values. The ASCII value for the character 'A' is 65. The output of the printf function will be 65.
Concept note The function f uses a static int y. The static keyword ensures that the variable y retains its value between function calls. The loop in the main function calls f six times with values from 0 to 5, and the return value of f is assigned to a each time. So, after the last interation 'a' will be equal to 15. The final output will be 15.
Concept note In C programming language, Register, Extern and Typedef are storage class specifiers. However, volatile is not a storage class specifier. It is a type qualifier that tells the compiler that a variable's value may be changed in ways not explicitly specified by the program.
Advertisement
Your privacy choices
We use essential cookies to keep the site secure and remember your choices. With your permission, analytics and advertising providers may use data for measurement, ad delivery, and ads personalization.
Essential storage is always active because it supports security, sessions, saved preferences, and core site features. The other choices are optional and can be changed later.
Essential
Required for security, forms, sessions, and remembering this consent choice.