InferenceAI

Enter at least two characters to search.

Start free

Programming and Data Structures

C programming, recursion, arrays, stacks, queues, linked lists, trees, heaps and hashing. 8 questions with worked solutions.

Q1NAT1 markBinary trees

What is the minimum possible height (counting edges) of a binary tree with 15 nodes?

Q2NAT2 marksBinary search trees

How many structurally distinct binary search trees can be built from the keys {1,2,3,4}\{1, 2, 3, 4\}?

Q3MCQ1 markStacks

What is the postfix form of A+B∗CA + B * C?

Q4NAT1 markBinary trees

What is the maximum number of nodes in a binary tree of height 4, where a single node has height 0?

Q5NAT1 markHashing

Keys 12, 22 and 32 are inserted in that order into an empty hash table of size 10 with h(k)=k mod 10h(k) = k \bmod 10 and linear probing. At which index is 32 stored?

Q6NAT2 marksRecursion

What does f(5) return?

c
int f(int n) {
    if (n <= 1) return 1;
    return f(n - 1) + f(n - 2);
}
Q7MCQ1 markHeaps

What is the time complexity of building a binary heap from nn unsorted elements using bottom-up heapify?

Q8MSQ2 marksLinked lists

Which operations take O(1)O(1) time on a singly linked list that keeps both head and tail pointers?

Select every correct option. There is no partial credit.