The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
All Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions and answers in Programming & DS
0
votes
1
answer
1
GATEBOOK2019DS120
Pointers to first and last nodes of a singly linked list are provided. Which of the following operations require a time complexity of $O(n)$ where $n$ is the size (number of elements) of linked list. Deleting the last node of the list. Insertion of a new node before first node of linked list. Addition of a new node at the end of the list. Deleting first node of linked list.
answered
2 hours
ago
in
Programming & DS
by
Hemang Jain
(
65
points)

16
views
gb2019ds1
0
votes
1
answer
2
GATEBOOK2019DS114
The pseudo code of a function is given below which takes an integer $n$ as its argument, and uses a stack S to process the number. void foo(int n) \{ stack S; while (n $\ge$ 1) \{ push(\&S, n\%2); n = n/2; \} while (! ... in reverse order Prints binary representation of n Prints the binary value of $\log n$ in reverse order Prints the binary value of $2^n$ in reverse order
answered
2 hours
ago
in
Programming & DS
by
Hemang Jain
(
65
points)

9
views
gb2019ds1
0
votes
0
answers
3
Linked list Quiz
Consider an unrolled linked list with $n$ elements.This list stores multiple elements in each node. What is the worst case time complexity to find the $k^{th}$ element if the number of nodes and the number of elements in each node are equal? $A)O(n)$ $B)O(\sqrt n)$ $C)O(nlogn)$ $D)O(n^{2})$
asked
2 hours
ago
in
Programming
by
Lakshman Patel RJIT
Boss
(
14.5k
points)

6
views
datastructure
linkedlists
0
votes
0
answers
4
Static Variable
Is it static declaration or static assignment? int main() { int x=20; static int y=x; if(x==y) printf("Equal"); else printf("Not Equal"); return 0; } What is output?and why?
asked
3 hours
ago
in
Programming
by
srestha
Veteran
(
101k
points)

35
views
programminginc
0
votes
1
answer
5
gateforum_test_series
answered
7 hours
ago
in
Programming
by
Mk Utkarsh
Boss
(
23.7k
points)

23
views
gateforumtestseries
programminginc
0
votes
0
answers
6
ME test series
asked
7 hours
ago
in
Programming
by
Ajit J
(
135
points)

16
views
+1
vote
1
answer
7
GATEBOOK2019DS219
Consider the following graph ? \Let number of shortest paths from node $a$ to node $j$ is represented by $A$, number of shortest paths from node $e$ to node $b$ is represented by $B$ and number of shortest paths from node $b$ to node $f$ is represented by $C$. Then the value of the expression: $A^B+B^C+C^A$ is: (A) 13 (B) 21 (C) 57 (D) 64
answered
7 hours
ago
in
Programming & DS
by
Naveen Kumar 3
Active
(
2.4k
points)

10
views
gb2019ds2
+1
vote
1
answer
8
GATEBOOK2019DS216
Consider the weighted undirected graph shown below: \The weight of the minimum spanning tree of the above graph is: 25 28 30 33
answered
7 hours
ago
in
Programming & DS
by
Naveen Kumar 3
Active
(
2.4k
points)

7
views
gb2019ds2
0
votes
1
answer
9
GATEBOOK2019DS214
For each of the following graphs, the number of spanning trees are A, B and C, respectively. \The value of $A*B+C$ is: 16 32 48 64
answered
8 hours
ago
in
Programming & DS
by
Naveen Kumar 3
Active
(
2.4k
points)

12
views
gb2019ds2
0
votes
2
answers
10
GATEBOOK2019DS27
In a binary tree with $n$ nodes, every nonleaf node has an even number of descendants. Every node is considered to be its own descendant. What is the number of nodes in the tree that have exactly one child? $0$ $1$ $\frac{(n  1)}{2}$ $n1$
answered
8 hours
ago
in
Programming & DS
by
Naveen Kumar 3
Active
(
2.4k
points)

36
views
gb2019ds2
0
votes
1
answer
11
Data structure
answered
8 hours
ago
in
Programming
by
Hemanth_13
Active
(
3.1k
points)

16
views
0
votes
1
answer
12
GATEBOOK2019DS116
Which of the following permutations of data items (as a result of pop operations), can not be obtained in the output using a stack, applying push and pop repeatedly, assuming that the input contains a sequence of 8 integers 1,2,3,4,5,6,7,8 pushed in that order? 3,4,5,2,7,6,1,8 3,4,5,2,8,7,6,1 1,5,4,6,8,7,3,2 5,4,3,2,7,1,6,8
answered
1 day
ago
in
Programming & DS
by
Naveen Kumar 3
Active
(
2.4k
points)

7
views
gb2019ds1
+1
vote
1
answer
13
gateforum_2019_test_series
answered
1 day
ago
in
Programming
by
Mk Utkarsh
Boss
(
23.7k
points)

29
views
gateforumtestseries
programminginc
+1
vote
1
answer
14
gateforum_Test
answered
1 day
ago
in
Programming
by
Mk Utkarsh
Boss
(
23.7k
points)

50
views
gateforumtestseries
programminginc
0
votes
0
answers
15
gateforum_test_series
[closed]
asked
1 day
ago
in
Programming
by
Shivam Kasat
(
457
points)

9
views
gateforumtestseries
programminginc
+1
vote
0
answers
16
homework
Consider the following recursive C function. If get (6) function is being called in main () then how many times will they get () Function be invoked before returning to the main ()?
[closed]
asked
1 day
ago
in
DS
by
deepanshu sharma 3
(
101
points)

28
views
+1
vote
1
answer
17
homework
Given an array A[1:6,2:10]. The base address of array is 1000. If every elements takes 4 bytes for storage then compute the address of element A[5,7] answer given is 1348
answered
1 day
ago
in
DS
by
Lakshman Patel RJIT
Boss
(
14.5k
points)

17
views
0
votes
0
answers
18
class problem
What is the minimum runtime to reverse a doubly linked list? answer given O(n) . shouldn't it be O(1) ?
asked
1 day
ago
in
Programming
by
deepanshu sharma 3
(
101
points)

26
views
+3
votes
1
answer
19
binary tree
Given a binary tree with n nodes and assuming size(x) denotes the number of nodes in the subtree rooted at the node x,how long does it take,in the worst case to compute size(x) for every node x of the tree? Choose the tightest upper bound. AO(height) BO(n) CO(nlogn) DO(n^2)
answered
1 day
ago
in
DS
by
LavTheRawkstar
Active
(
5.2k
points)

552
views
0
votes
0
answers
20
#geeks_quiz_datastructure
Consider the following list of the integer: 19, 23, 40, 32, 91, 25, 100, 36 Sort this list in increasing order using insertion sort and determine the number of passes, comparisons, and swaps ? A 7, 14, 8 respectively. B 7, 7, 14 respectively. C 8, 7, 12 respectively. D 8, 14, 7 respectively.
asked
1 day
ago
in
Programming
by
anjali007
Junior
(
975
points)

19
views
0
votes
0
answers
21
homework
Consider the following function: int unknown(int n){ int i, j, k=0; for (i=n/2; i<=n; i++) for (j=2; j<=n; j=j*2) k = k + n/2; return (k); } The return value of the function is ? answer given is n^2 log n
[closed]
asked
1 day
ago
in
Programming
by
deepanshu sharma 3
(
101
points)

21
views
0
votes
1
answer
22
drdo 2013
let A(1:8, 5:5, 10:5) be a three dimentional arrey. how many elements are there in the arrey A
answered
1 day
ago
in
Programming
by
anjali007
Junior
(
975
points)

14
views
0
votes
0
answers
23
#Selfdoubt
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is: a) O(logn) b)O(n) c)O(1) d)O(log*n)
asked
1 day
ago
in
Programming
by
anjali007
Junior
(
975
points)

11
views
0
votes
0
answers
24
ibps2015
the scope of a variable is 1. the range of values that can be assigned to a variable 2. the program area is which the variable is accessible 3. the maximum number of characters that can be allowed in the name of variable 4. both 1 and 2
asked
2 days
ago
in
Programming
by
Kushagra1234
(
43
points)

9
views
+4
votes
5
answers
25
GO2017Programming13
What will be the output of the following code? #include <stdio.h> #include <string.h> int main() { char string[] = "Hello"; if(sizeof(string) <= strlen(string)) printf("1"); printf("0"); } ______
answered
2 days
ago
in
Programming
by
Bharathchinna0402
(
19
points)

564
views
go2017programming1
programminginc
programming
numericalanswers
0
votes
0
answers
26
GATEBOOK_DSA5_7
Which of the following provides a lower bound on the number of comparisons needed to find the kth largest element in an array of n integer elements? (A) n ∗ k (B) n + k − log n (C) min (n + k − 1, 2(n − k + 1)) (D) n − 1 + min (k − 1, n − k)
asked
2 days
ago
in
Programming
by
Ayush Upadhyaya
Boss
(
16.1k
points)

51
views
algorithms
0
votes
0
answers
27
GATEBOOK_DSA5_6
Narendra is traveling from point A to point B and there are n toll posts along the way. Before starting the journey, Narendra is given, for each post 1 ≤ i < j ≤ n, the feeto travel from post i to post j. The goal is to minimize the travel ... The answer is given to be (C). Is it like this has been solved using Dijkstra using fibonacci heaps? Am I thinking in correct direction?
asked
2 days
ago
in
Programming
by
Ayush Upadhyaya
Boss
(
16.1k
points)

9
views
algorithms
0
votes
2
answers
28
ibps2014
the run time for traversing all the nodes of a binary search tree with n nodes and printing them in an order is 1. o (n log n) 2. o (n) 3. o(sqrt(n)) 4. o (log n)
answered
2 days
ago
in
Programming
by
Shamim Ahmed
Junior
(
593
points)

10
views
0
votes
1
answer
29
ibps 2014
if n elements are sorted in a binary search tree .what would be the asymptotic complexity to search a key in the tree. a. o(1) b. 0(log n) c. o(n) d. o(n log n)
answered
2 days
ago
in
Programming
by
Shamim Ahmed
Junior
(
593
points)

8
views
0
votes
0
answers
30
programming
#include<stdio.h> int(*foo())[3] { static int a[3]={1,2,3}; printf("%d",*a); return &a; } int main() { static int (*p)[3]; p=foo(); printf("%d",*(*p+2)); return 0; } i try to make picture representation i think this is wrong please make correct
asked
2 days
ago
in
Programming
by
Gurdeep Saini
Active
(
3.3k
points)

38
views
programminginc
programming
0
votes
1
answer
31
Parameter Passing
Predict the Output for both the snippets for the following: 1. Call by Value 2. Call by Reference 3. Call by Need 4. Call by Name 5. Call by value Result/Call by value Return(Copy Restore) 6. Call by Text
answered
2 days
ago
in
Programming
by
Shubhgupta
Active
(
4.2k
points)

29
views
programminginc
parameterpassing
0
votes
0
answers
32
LinkedList
[closed]
asked
2 days
ago
in
DS
by
Abhisek Tiwari 4
Active
(
1.5k
points)

45
views
0
votes
0
answers
33
made easy test series
what will be the output?
asked
2 days
ago
in
Programming
by
amitqy
Junior
(
757
points)

40
views
0
votes
0
answers
34
Vgate
State true or false: S1: The depth of a breadthfirst search tree on an undirected graph G = (V, E) from an arbitrary vertex v ∈ V is the diameter of the graph G. (The diameter d of a graph is the smallest d such that every pair of vertices s and t have δ(s, t) ≤ d.)
asked
2 days
ago
in
Programming
by
Abhisek Tiwari 4
Active
(
1.5k
points)

6
views
0
votes
0
answers
35
GATEBOOK_DSA4_17
If Radix sort is used to sort an array of n integers which are in the range , where d is some function of input size, the time taken would be? (A) (B) (C) (D) I know that Radix sort takes $\theta(d(n+k))$ times over 'd' digits of numbers, ... sort it uses takes $\theta(n+k)$ times in each pass where k represents the range of input numbers. I am unable to solve this. Please help.
asked
2 days
ago
in
Programming
by
Ayush Upadhyaya
Boss
(
16.1k
points)

15
views
algorithms
0
votes
1
answer
36
GATEBOOK2019DS125
A stack is implemented using two queues. Initially the stack is empty. Then following sequence of operations are performed on stack: $push(3), push(2), push(4), push(5), push(1), pop(), pop(), push(1), pop(), pop(), pop()$. Total ... performed on queues in order to simulate these stack operations is, (assuming $pop()$ is less costly between the two operations.): 28 31 35 37
answered
2 days
ago
in
Programming & DS
by
Karthik Selvam
(
199
points)

11
views
gb2019ds1
0
votes
1
answer
37
GATEBOOK2019DS126
Which of the following option is not correct? If the queue is implemented with a linked list, keeping track of a front pointer, Only rear pointer s will change during an insertion into an nonempty queue. Queue data structure can be used to implement least ... can be used to implement Quick short algorithm but not least recently used (LRU) page fault algorithm. Both (A) and (C)
answered
2 days
ago
in
Programming & DS
by
Karthik Selvam
(
199
points)

10
views
gb2019ds1
+2
votes
1
answer
38
DS Made easy
answered
3 days
ago
in
Programming
by
Hemanth_13
Active
(
3.1k
points)

67
views
0
votes
0
answers
39
GATEBOOK_DSA4_2
In which of the cases shown below, Binary search can not always be applied for searching (A) Hierarchical data record (B) Internet Domain name conversion (C) Searching a telephone number in directory (D) An array of integers Answer is given to be (D). I thought it must be (B). Please help. I understand (D) is okay when the array is not sorted.But what about other options?
asked
3 days
ago
in
Programming
by
Ayush Upadhyaya
Boss
(
16.1k
points)

38
views
algorithms
binarysearch
0
votes
0
answers
40
GATEBOOKDSA4_8
Consider a sorted array A of n integer elements, A[0]...A[n − 1]. A search operation is to be performed on this array using .Binary search algorithm. If the element being searched is in fact the last element of the array, what is the difference between the index of element ... , \frac{7n1}{8}=\frac{n7}{8}$ This is my answer.But it matches none of the options. Where I went wrong?
asked
3 days
ago
in
Programming
by
Ayush Upadhyaya
Boss
(
16.1k
points)

24
views
datastructure
binarysearch
algorithms
To see more, click for all the
questions in this category
.
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
Members at the site
lakshaysaini2013
Magma
Subramanyam
`JEET
Kunal Kadian
ankitgupta.1729
Recent Posts
Basic LaTeX guide
IIT Madras Phd
Databases GO Classroom
Happy Birthday Sir Arjun
NIELIT EXAM DATE 2018
All categories
General Aptitude
1.4k
Engineering Mathematics
6.3k
Digital Logic
2.4k
Programming & DS
4.4k
Programming
3.2k
DS
1.2k
Algorithms
3.8k
Theory of Computation
4.8k
Compiler Design
1.8k
Operating System
3.5k
Databases
3.5k
CO & Architecture
3k
Computer Networks
3.5k
Non GATE
1.2k
Others
1.3k
Admissions
509
Exam Queries
491
Tier 1 Placement Questions
23
Job Queries
64
Projects
17
Follow @csegate
Gatecse
Recent questions and answers in Programming & DS
Recent Blog Comments
Sir for final year student who have exam in...
I guess you meant while chasing :) Anyway those...
I'll write a post on how to best...
@Gaurav Go through all the previous yr questions,...
42,599
questions
48,599
answers
155,660
comments
63,731
users