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 Bhaiya
368
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 Bhaiya
by
gate_dreams
368
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 19, 2016
653
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 19, 2016
by
Payal Rastogi
653
views
time-complexity
algorithms
ace-booklet
1
vote
1
vote
2
answers
2
APOORV PANSE
asked
in
Algorithms
Jun 1, 2016
3,011
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
3.0k
views
asymptotic-notation
time-complexity
algorithms
ace-booklet
1
vote
1
vote
0
answers
3
Ankush Tiwari
asked
in
Algorithms
Jul 27, 2016
659
views
Ace Practice booklet
T(n)=sqrt(2T(n/2))+logn
Ankush Tiwari
asked
in
Algorithms
Jul 27, 2016
by
Ankush Tiwari
659
views
ace-booklet
time-complexity
recurrence-relation
0
votes
0
votes
1
answer
4
JAYKISHAN
asked
in
Algorithms
Jul 5, 2018
815
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
815
views
algorithms
ace-booklet
divide-and-conquer
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
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
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy