search
Log In
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users 2021 Jun 14 - 20
  1. mtech_student

    60 Points

  2. Subhajit Panday

    6 Points

  3. Sambhrant Maurya

    4 Points

Weekly Top User (excluding moderators) will get free access to GATE Overflow Test Series for GATE 2021

Recent questions and answers in Algorithms

0 votes
0 answers 4 views
is bubble sort an online algorithm? cause whenever new element is fed, it can be take to its place by swapping the adjacent numbers. is my thinking right?
asked 1 day ago in Algorithms rythmrana 5 points 4 views
3 votes
1 answer 821 views
Consider the following three functions. $f_1=10^n\quad f_2=n^{\log n}\quad f_3=n^{\sqrt {n}}$ Which one of the following options arranges the functions in the increasing order of asymptotic growth rate? $f_3, f_2, f_1$ $f_2, f_1, f_3$ $f_1, f_2,f_3$ $f_2, f_3, f_1$
answered 1 day ago in Algorithms amitkhurana512 53 points 821 views
0 votes
0 answers 4 views
for an almost sorted array, which algorithm is better, shell sort or insertion sort? and also for a fully sorted array?
asked 2 days ago in Algorithms rythmrana 5 points 4 views
0 votes
0 answers 4 views
I am currently studying dynamic programming for GATE 2022. I am kinda stuck with which problems to prioritize. Can someone help? #dynamic-programming
asked 2 days ago in Algorithms ankit-saha 5 points 4 views
0 votes
0 answers 4 views
if we require a large(more than size of array or 1000000mb) but constant( irrespective of size of input array) extra space for an algorithm, will the algorithm be in place or not? the extra space is not required to manipulate the elements of array but may be required for some other purpose.
asked 2 days ago in Algorithms rythmrana 5 points 4 views
0 votes
0 answers 5 views
We can reduce the space complexity of heapsort to o(1) by using heapify using loops, then why we dont reduce the space complexity of heapify from o(logn) to o(1) by using loops here also.?
asked Jun 9 in Algorithms Ayush1718 5 points 5 views
0 votes
1 answer 13 views
This is in regards to Binary tree. The question is The image given below is full binary tree or not?
answered Jun 8 in Algorithms Subhajit Panday 11 points 13 views
0 votes
0 answers 11 views
Hi Experts, I have been practicing Master Theorem since Yesterday as I am recently involved in algorithm course. I have found a hard the following problem whether the Master Theorem is applicable or it violates rules. if yes then kindly elaborate for better understanding…. Apology for English grammar T(n) = 2^1.534T( n 2 ) + 2^ 2n
asked Jun 1 in Algorithms Irfan123 5 points 11 views
1 vote
1 answer 10 views
Every graph having minimum one spanning tree 1. True 2.False Which is correct? My doubt is spanning tree is possible for any type of graph??
answered May 29 in Algorithms Deepakk Poonia (Dee) 1.7k points 10 views
0 votes
1 answer 33 views
Hi, I do not succeed in this question: Need to construct a right-linear grammar Would appreciate help :)
answered May 12 in Algorithms aryavart 73 points 33 views
0 votes
0 answers 11 views
T(n)=T(n-1)-1 what is complexity of this
asked May 6 in Algorithms Rahul06 5 points 11 views
0 votes
0 answers 8 views
Considering the Huffman coding algorithm, the Huffman (encoding) tree requires more number of nodes than the distinct number of characters from the input file (say ‘n’). Then how is the space complexity for the algorithm = O(n), assuming the min-heap is operated on recursively?
asked May 2 in Algorithms Nabankur Dey 5 points 8 views
0 votes
0 answers 11 views
Find a longest common subsequence between following strings: String1= {1, 2, 3, 4, 5, 6, 7, 8} String2={1,1,9,1,9,7,3,9} (Neatly show all the steps and also write the algorithm)(Analyze the running time of the given problem).
asked May 2 in Algorithms Danido1 5 points 11 views
0 votes
0 answers 5 views
n^3 + n^2logn = bigoh(n^3) For satisfying above equation what should be the value of c??
asked May 2 in Algorithms Vink7389 9 points 5 views
0 votes
0 answers 4 views
If a graph contains n vertices then in minimum spanning tree(MST) will contain Minimum(n-1) edges Exact (n-1) edges. What will be the answer for this?? Plz explain with example for better understanding.
asked May 2 in Algorithms Vink7389 9 points 4 views
0 votes
1 answer 40 views
what is the time complexity in f( int n) { if(n <=2) return 1 else return f(floor(sqrt(n))) + n; }
answered Apr 28 in Algorithms ASNR1010 5 points 40 views
0 votes
0 answers 8 views
Is binary search possible in sorted array where some elements repeat in array??
asked Apr 18 in Algorithms Vink7389 9 points 8 views
0 votes
0 answers 19 views
Sir, can ypu help me to find vedio solutions for all pyq questions that are asked in gate exam goup by subjects Thanks in advance
asked Apr 14 in Algorithms RACHAPUDI JAGADEESH 5 points 19 views
0 votes
0 answers 11 views
In quick sort the time complexity equation is T(n)=T(k)+T(n-k-1)+⊝(n) in average case how does the equation comes out to be T(n)=T(n/9)+T(9n/10)+⊝(n) in Average case.
asked Apr 4 in Algorithms soham04 5 points 11 views
0 votes
0 answers 18 views
in this question since they are asking function time so it depends on n and so that’s y time is O(1)?
asked Mar 27 in Algorithms G Shaheena 5 points 18 views
0 votes
1 answer 19 views
How to Implement a stack with a priority queue ?
answered Mar 17 in Algorithms blank_manash 65 points 19 views
0 votes
0 answers 24 views
What is the correct answer for this question.Please give the detailed solution…..
asked Mar 12 in Algorithms holla 5 points 24 views
0 votes
0 answers 31 views
Q.9 Determine the asymptotic running time of f(n) for the following C program. Int f(int n) int x; if (n == 0) x = 1: else x = f(n-1) 2; g(x): return x; void g(int m) { int y: for (y = m, y > 0; y/ = 2):}
asked Mar 12 in Algorithms Harshit2021 5 points 31 views
0 votes
0 answers 29 views
Here, Chapter 9 is missing. This makes me loose 2 marks. Because I blindly believed that the content described in this material is accurate. So plz update the latest content in this material.
asked Mar 11 in Algorithms Raj_81 23 points 29 views
0 votes
1 answer 24 views
True/False 1) Multiplying all edge weight by a positive number might change the graph MST. 2) If all edge in a graph have distinct weight than the shortest path between two vertices is unique. Please answer with reason. Thanks
answered Feb 27 in Algorithms Deepakk Poonia (Dee) 1.7k points 24 views
1 vote
0 answers 18 views
1) Time complexity to construct a Binary tree when inorder and preorder/postorder traversal of the tree is given. a) if inorder sorted b) if inorder is not sorted. 2) If construct Binary tree when pre-order and postorder to the tree is given. .....… My answer: 1 a) O( nlogn) 1 b) O(nlogn) 2) O(2^n) Please check and correct Thanks
asked Feb 27 in Algorithms Hradesh patel 9 points 18 views
4 votes
3 answers 1.4K views
Let $G$ be a connected undirected weighted graph. Consider the following two statements. $S_1$: There exists a minimum weight edge in $G$ which is present in every minimum spanning tree of $G$. $S_2$: If every edge in $G$ has distinct weight, then $G$ has a unique minimum spanning ... $S_1$ is true and $S_2$ is false $S_1$ is false and $S_2$ is true Both $S_1$ and $S_2$ are false
asked Feb 18 in Algorithms Arjun 257 points 1.4K views
0 votes
2 answers 999 views
What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size $n$? $\Theta ( \sqrt{n})$ $\Theta (\log _2(n))$ $\Theta(n^2)$ $\Theta(n)$
asked Feb 18 in Algorithms Arjun 257 points 999 views
3 votes
2 answers 656 views
Consider the following $\text{ANSI C}$ function: int SomeFunction (int x, int y) { if ((x==1) || (y==1)) return 1; if (x==y) return x; if (x > y) return SomeFunction(x-y, y); if (y > x) return SomeFunction (x, y-x); } The value returned by $\textrm{SomeFunction(15, 255)}$ is __________
asked Feb 18 in Algorithms Arjun 257 points 656 views
2 votes
2 answers 869 views
Consider the string $\textrm{abbccddeee}$. Each letter in the string must be assigned a binary code satisfying the following properties: For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter. For any two letters ... assignments which satisfy the above two properties, what is the minimum length of the encoded string? $21$ $23$ $25$ $30$
asked Feb 18 in Algorithms Arjun 257 points 869 views
4 votes
3 answers 905 views
For constants $a \geq 1$ and $b>1$, consider the following recurrence defined on the non-negative integers: $T(n) = a \cdot T \left(\dfrac{n}{b} \right) + f(n)$ Which one of the following options is correct about the recurrence $T(n)$? If $f(n)$ is $n \log_2(n)$, then $T(n)$ ... $\Theta(n^{\log_b(a)})$ If $f(n)$ is $\Theta(n^{\log_b(a)})$, then $T(n)$ is $\Theta(n^{\log_b(a)})$
asked Feb 18 in Algorithms Arjun 257 points 905 views
2 votes
2 answers 817 views
Consider the following directed graph: Which of the following is/are correct about the graph? The graph does not have a topological order A depth-first traversal starting at vertex $S$ classifies three directed edges as back edges The graph does not have a strongly connected component For each pair of vertices $u$ and $v$, there is a directed path from $u$ to $v$
asked Feb 18 in Algorithms Arjun 257 points 817 views
3 votes
2 answers 696 views
Consider the following $\text{ANSI C}$ program #include <stdio.h> int foo(int x, int y, int q) { if ((x<=0) && (y<=0)) return q; if (x<=0) return foo(x, y-q, q); if (y<=0) return foo(x-q, y, q); return foo(x, y-q, q) + foo(x-q, y, q); } int main( ) { int r = foo(15, 15, 10); printf(“%d”, r); return 0; } The output of the program upon execution is _________
asked Feb 18 in Algorithms Arjun 257 points 696 views
3 votes
2 answers 868 views
In a directed acyclic graph with a source vertex $\textsf{s}$, the $\textit{quality-score}$ of a directed path is defined to be the product of the weights of the edges on the path. Further, for a vertex $v$ other than $\textsf{s}$, the quality-score of $v$ is ... quality-score of $\textsf{s}$ is assumed to be $1$. The sum of the quality-scores of all vertices on the graph shown above is _______
asked Feb 18 in Algorithms Arjun 257 points 868 views
2 votes
3 answers 854 views
Consider the following array.$\begin{array}{|l|l|l|l|l|l|} \hline 23&32&45&69&72&73&89&97 \\ \hline\end{array}$ Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order? Selection sort Mergesort Insertion sort Quicksort using the last element as pivot
asked Feb 18 in Algorithms Arjun 257 points 854 views
0 votes
3 answers 859 views
Consider the following undirected graph with edge weights as shown: The number of minimum-weight spanning trees of the graph is ___________.
asked Feb 18 in Algorithms Arjun 257 points 859 views
5 votes
5 answers 1.9K views
Consider the following recurrence relation. $T\left ( n \right )=\left\{\begin{array} {lcl} T(n ∕ 2)+T(2n∕5)+7n & \text{if} \; n>0\\1 & \text{if}\; n=0 \end{array}\right.$ Which one of the following options is correct? $T(n)=\Theta (n^{5/2})$ $T(n)=\Theta (n\log n)$ $T(n)=\Theta (n)$ $T(n)=\Theta ((\log n)^{5/2})$
asked Feb 18 in Algorithms Arjun 257 points 1.9K views
1 vote
2 answers 1.1K views
Define $R_n$ to be the maximum amount earned by cutting a rod of length $n$ meters into one or more pieces of integer length and selling them. For $i>0$, let $p[i]$ denote the selling price of a rod whose length is $i$ meters. Consider the array of prices: ... $R_7$? $R_7=18$ $R_7=19$ $R_7$ is achieved by three different solutions $R_7$ cannot be achieved by a solution consisting of three pieces
asked Feb 18 in Algorithms Arjun 257 points 1.1K views
2 votes
1 answer 646 views
Consider a $\textit{dynamic}$ hashing approach for $4$-bit integer keys: There is a main hash table of size $4$. The $2$ least significant bits of a key is used to index into the main hash table. Initially, the main hash table entries are empty. Thereafter, when more keys are hashed into it, to resolve ... in decimal notation)? $5,9,4,13,10,7$ $9,5,10,6,7,1$ $10,9,6,7,5,13$ $9,5,13,6,10,14$
asked Feb 18 in Algorithms Arjun 257 points 646 views
1 vote
3 answers 463 views
Consider the following $\text{ANSI C}$ function: int SimpleFunction(int Y[], int n, int x) { int total = Y[0], loopIndex; for (loopIndex=1; loopIndex<=n-1; loopIndex++) total=x*total +Y[loopIndex]; return total; } Let $\textsf{Z}$ be an array of $10$ elements with $\textsf{Z}[i]=1$, for all $i$ such that $0 \leq i \leq 9$. The value returned by $\textsf{SimpleFunction(Z},10,2)$ is __________
asked Feb 18 in Algorithms Arjun 257 points 463 views
To see more, click for all the questions in this category.
...