top of page
Courses
Blog
Search
Ask & Answer
Forum
Log In
All Posts
Basics of Linux
Algorithms
Past Year Papers
Ask & Answer
DPPs
RCs
Search
Dhruv Badaya
May 26, 2024
1 min read
In the following two-ply game tree, the terminal nodes show the utility values computed by the utility function. Use the Minimax algorithm to compute the utility values for other nodes in the given...
Dhruv Badaya
May 26, 2024
1 min read
Write a context-free grammar that can accept the sentence: "Ram hit the ball".
Dhruv Badaya
May 26, 2024
1 min read
Describe the following terms: (a) Heuristic Function (b) Software Agent
Dhruv Badaya
May 26, 2024
1 min read
Given an array A of n integers, you need to find the maximum sum of any contiguous subarray. For instance, the maximum sum of any contiguous subarray in the array -1, 2, 3, -2, 5, -6, 7, -8 is 9...
Dhruv Badaya
May 26, 2024
1 min read
Suppose we perform a sequence of stack operations on a stack whose size never exceeds k. After every k operations, we make a copy of the entire stack for backup purposes. Show that the cost of n st...
Dhruv Badaya
May 26, 2024
1 min read
Show that, with the array representation for sorting an n-element heap, the leaves are the nodes indexed by floor(n/2+1), floor(n/2+2), …,n. What would be the location of the minimum element in the...
Dhruv Badaya
May 26, 2024
1 min read
What is the minimum number of leaves in the decision tree for a comparison sort? Use this observation to derive a lower bound on the number of comparisons performed by a comparison sort in the wors...
Dhruv Badaya
May 26, 2024
5 min read
Design and Analysis of Algorithms (DAA) - B.Sc. (Hons.) Computer Science - Delhi University 2023 Question Paper
Dhruv Badaya
May 26, 2024
1 min read
What is the smallest possible depth of a leaf in a decision tree for a comparison sort? Name a sorting technique to which this smallest depth would correspond.
Dhruv Badaya
May 26, 2024
1 min read
Let G = (V,E) be a directed unweighted graph. Given two vertices s and t in V, what is the time required to determine if there exists at least one s-t path in G? Can we use the DFS algorithm to fin...
Dhruv Badaya
May 26, 2024
2 min read
A student was asked to sort a list of n numbers in decreasing order. The student writes an algorithm that works iteratively as follows. In every iteration, the following two steps are done...
Dhruv Badaya
May 26, 2024
1 min read
For each of the following sorting algorithms, merge sort and insertion sort, discuss whether or not it is (i) stable and (ii) in-place
Dhruv Badaya
May 26, 2024
2 min read
Consider the scheduling problem wherein you are given a single resource and a set of requests having deadlines. A request is said to be late be late if it misses the deadline. Your goal is to minim...
Dhruv Badaya
May 26, 2024
1 min read
Show that in any subtree of a max-heap, the root of the subtree contains the largest value occurring anywhere in that subtree.
Dhruv Badaya
May 26, 2024
1 min read
We are given a weighted graph G in which edge weights are not necessarily distinct. Can graph G have more than one minimum spanning tree (MST)? If yes, give an example, else justify.
Dhruv Badaya
May 26, 2024
1 min read
Why is the worst-case running time for bucket sort θ(n²)? What changes would you make to the algorithm so that its worst-case running time becomes O(nlgn)?
Dhruv Badaya
May 25, 2024
1 min read
Specify whether the above graph is bipartite or not. If yes, give the partition, else justify.
Dhruv Badaya
May 25, 2024
1 min read
Let G be a tree graph. Further, let A and B be the trees produced by performing BFS and DFS respectively on G. Can A and B be different trees? Why or why not?
Dhruv Badaya
May 25, 2024
1 min read
How many topological orderings does the following graph have? Specify all of them.
Dhruv Badaya
May 25, 2024
1 min read
Can dynamic programming be applied to all optimization problems? Why or why not?
2
3
4
5
6
bottom of page