Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Ace dlp
gate_dreams
asked
in
Algorithms
Jan 27, 2019
retagged
Jun 24, 2022
by
Lakshman Patel RJIT
163
views
0
votes
0
votes
for(i=n, j=0; i>0; i/=2, j+=i)
Let val(j) denote the value stored in the variable j after termination of the for loop. Whjch is correct?
a. val(j)=theta(logn)
b. Val(j)= theta(√n)
c. Val(j) = theta(n)
d. Val(j) = theta(nlogn)
ace-booklet
algorithms
time-complexity
gate_dreams
asked
in
Algorithms
Jan 27, 2019
retagged
Jun 24, 2022
by
Lakshman Patel RJIT
by
gate_dreams
163
views
answer
comment
Follow
share this
share
1 comment
by
Verma Ashish
commented
Jan 28, 2019
reply
Follow
share this
$j=n+\frac{n}{2} +\frac{n}{4}+\frac{n}{8} +\ldots$
Decreasing GP $1+1/2+1/4+1/8+1/16+\ldots =O(1)$
So $val(j)=\theta (n)$
0
0
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
0
votes
0
votes
n/2^k=1
n=2^k
k=log2n
ans is A
gorya506
answered
Aug 17, 2019
by
gorya506
comment
Follow
share this
0 Comments
Please
log in
or
register
to add a comment.
← Previous
Next →
← Previous in category
Next in category →
Related questions
0
votes
0
votes
2
answers
1
Payal Rastogi
asked
in
Algorithms
Oct 20, 2016
394
views
Ace Page# 128, Q#48
I think the median can be found in O(n), because in O(n) we can merge the arrays into a single sorted array and in O(1) we can find the middle element of the array. Am I correct ??
Payal Rastogi
asked
in
Algorithms
Oct 20, 2016
by
Payal Rastogi
394
views
time-complexity
algorithms
ace-booklet
1
vote
1
vote
2
answers
2
APOORV PANSE
asked
in
Algorithms
Jun 1, 2016
2,407
views
Analysis of code fragment to find time complexity [ACE Gate Practice Booklet Volume 1 Page 127 Question 32]
APOORV PANSE
asked
in
Algorithms
Jun 1, 2016
by
APOORV PANSE
2.4k
views
asymptotic-notations
time-complexity
algorithms
ace-booklet
1
vote
1
vote
0
answers
3
Ankush Tiwari
asked
in
Algorithms
Jul 27, 2016
517
views
Ace Practice booklet
T(n)=sqrt(2T(n/2))+logn
Ankush Tiwari
asked
in
Algorithms
Jul 27, 2016
by
Ankush Tiwari
517
views
ace-booklet
time-complexity
recurrence-relation
0
votes
0
votes
1
answer
4
JAYKISHAN
asked
in
Algorithms
Jul 5, 2018
538
views
ACE Algorithms volume 2 Divede and Conquer Q 11
Given two sorted double linked list L1 and L2 of n elements each, which of the following are true? (A) L1 and L2 can be merged into single sorted list in Θ(n) time. (B) L1 and L2 can be merged into single sorted list in Θ(1) time. ( ... merged into single sorted list in Θ(nlogn) time. (D) L1 and L2 can be merged into single sorted list in Θ(n2) time.
JAYKISHAN
asked
in
Algorithms
Jul 5, 2018
by
JAYKISHAN
538
views
algorithms
ace-booklet
divide-and-conquer
Subscribe to GATE CSE 2023 Test Series
Subscribe to GO Classes for GATE CSE 2023
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
Recent Posts
GATE CSE 2023 Paper & Analysis - Memory Based
From GATE to Australia
DRDO Previous Year Papers
From Rank 4200 to 64: My Journey to Success in GATE CSE Exam
What are the key things to focus on during the final 10-15 days before the GATE exam to improve performance?
Subjects
All categories
General Aptitude
(2.5k)
Engineering Mathematics
(9.3k)
Digital Logic
(3.3k)
Programming and DS
(5.9k)
Algorithms
(4.6k)
Theory of Computation
(6.7k)
Compiler Design
(2.3k)
Operating System
(5.0k)
Databases
(4.6k)
CO and Architecture
(3.8k)
Computer Networks
(4.6k)
Non GATE
(1.3k)
Others
(2.4k)
Admissions
(649)
Exam Queries
(842)
Tier 1 Placement Questions
(17)
Job Queries
(74)
Projects
(9)
Unknown Category
(853)
Recent Blog Comments
when is next analysis starting?
This guy was just exceptional. I remember hearing...
Inspirational! Found the right Blog at the right...
That was my second attempt. I already had notes,...
Sorry to break the news, but: I see a few flaws...
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy