All Subjects
Bahria University10 الأسئلة

Advanced Algorithms and Data Structures MCQs

Practice Advanced Algorithms and Data Structures multiple-choice questions for Bahria University competitive exams. Each question includes the correct answer and a short explanation, and past-paper questions are marked so you can revise both repeated and fresh material in one place.

O(1)
O(log n)
O(n)
O(n log n)
الشرحIn a Fibonacci heap, the delete-min operation involves consolidating the root list, which takes amortized O(log n) time.
Dijkstra's Algorithm
Bellman-Ford Algorithm
Prim's Algorithm
Kruskal's Algorithm
الشرحDijkstra fails with negative edges, while Bellman-Ford can handle them correctly by relaxing edges V-1 times.
m/2
ceil(m/2)
floor(m/2)
m-1
الشرحTo maintain the balance of a B-tree, non-root internal nodes must be at least half full, defined as ceil(m/2) children.
Binary Max-Heap
Pairing Heap
Van Emde Boas Tree
Sorted Linked List
الشرحVan Emde Boas trees provide O(log log U) time complexity for priority queue operations, where U is the universe size, outperforming standard heaps for certain integer ranges.
O(n log n)
O(n)
O(n^2)
O(log n)
الشرحWhen the pivot is consistently extreme, the partition becomes highly unbalanced, resulting in a depth of n, leading to O(n^2) complexity.
Dijkstra's Algorithm
Kruskal's Algorithm
Bellman-Ford Algorithm
Floyd-Warshall Algorithm
الشرحKruskal's algorithm sorts all edges by weight and adds them sequentially if they do not form a cycle, which is a greedy strategy for MST.
Guaranteed O(1) search time
Lower space complexity
Easier implementation for concurrent operations
Smaller constant factors
الشرحSkip lists are highly preferred in concurrent programming because they allow localized updates, avoiding the global rebalancing locks required by trees like AVL or Red-Black trees.
Greedy Algorithm
Dynamic Programming
Backtracking
Divide and Conquer
الشرحDynamic programming is used to solve the Knapsack problem by breaking it down into overlapping subproblems and storing results to build the optimal solution.
The recurrence must be in the form T(n) = aT(n/b) + f(n)
The subproblems must be solved sequentially
The function f(n) must be logarithmic
The problem must be non-recursive
الشرحThe Master Theorem provides a cookbook solution for recurrences of the specific form T(n) = aT(n/b) + f(n).
log2(n+1)
2 log2(n+1)
n
log2(n)
الشرحDue to the balancing properties (red nodes cannot have red children, paths have equal black nodes), the height is guaranteed to be at most 2 log2(n+1).

Frequently Asked Questions

Are these Advanced Algorithms and Data Structures MCQs free?

Yes. Every Advanced Algorithms and Data Structures MCQ on this page is free to practice, including the correct answer and explanation.

Do these include past-paper questions?

Yes — questions sourced from past papers are clearly marked with a "Past Paper" badge, alongside fresh practice questions.

Which exams do these Advanced Algorithms and Data Structures MCQs help with?

They are aimed at Bahria University and related Pakistani competitive exams that test Advanced Algorithms and Data Structures.

How should I practice subject-wise MCQs?

Attempt each question first, then reveal the answer and read the explanation. Short, focused sessions on one subject work better than long unstructured reading.

نستخدم ملفات تعريف الارتباط

نستخدم ملفات أساسية لتشغيل المنصة وملفات تحليلات لفهم الاستخدام. يمكنك قبول أو رفض ملفات التحليلات والإعلانات.