Complexity of many constant time steps with occasional logarithmic steps Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Upper-bounding the number of comparisons for Sorting to $Theta(n)$ using a physically big number like Number of Particles in the UniverseWhy does this mergesort variant not do Θ(n) comparisons on average?Why does the total credit associated with a data structure must be nonnegative at all times for the accounting method?How does the token method of amortized analysis work in this example?In Amortized Analysis, can we chose how big $n$ is?Incremental strongly connected componentsThe validity of the potential function for splay treeClock page replacement policy vs LRU page replacement policy, is Clock more efficient?if binary heap potential function is c*size(binary heap)) then insert will not take O(logn)and extract min will not take O(1) amortized timeMergable heap with no key knowledge cannot EXTRACT-MIN in $o(log n)$ amortized time
Time to Settle Down!
Why limits give us the exact value of the slope of the tangent line?
Why are vacuum tubes still used in amateur radios?
Is there hard evidence that the grant peer review system performs significantly better than random?
Product of Mrówka space and one point compactification discrete space.
Triggering an ultrasonic sensor
How often does castling occur in grandmaster games?
Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?
How were pictures turned from film to a big picture in a picture frame before digital scanning?
What initially awakened the Balrog?
Question about debouncing - delay of state change
Find 108 by using 3,4,6
What are the diatonic extended chords of C major?
Should there be a hyphen in the construction "IT affin"?
Update module to run alter command
Amount of permutations on an NxNxN Rubik's Cube
How do I find out the mythology and history of my Fortress?
Why weren't discrete x86 CPUs ever used in game hardware?
How would a mousetrap for use in space work?
What would you call this weird metallic apparatus that allows you to lift people?
How to tell that you are a giant?
How much damage would a cupful of neutron star matter do to the Earth?
Did any compiler fully use 80-bit floating point?
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
Complexity of many constant time steps with occasional logarithmic steps
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Upper-bounding the number of comparisons for Sorting to $Theta(n)$ using a physically big number like Number of Particles in the UniverseWhy does this mergesort variant not do Θ(n) comparisons on average?Why does the total credit associated with a data structure must be nonnegative at all times for the accounting method?How does the token method of amortized analysis work in this example?In Amortized Analysis, can we chose how big $n$ is?Incremental strongly connected componentsThe validity of the potential function for splay treeClock page replacement policy vs LRU page replacement policy, is Clock more efficient?if binary heap potential function is c*size(binary heap)) then insert will not take O(logn)and extract min will not take O(1) amortized timeMergable heap with no key knowledge cannot EXTRACT-MIN in $o(log n)$ amortized time
$begingroup$
I have a data structure that can perform a task $T$ in constant time, $O(1)$. However, every $k$th invocation requires $O(logn)$, where $k$ is constant.
Is it possible for this task to ever take amortized constant time, or is it impossible because the logarithm will eventually become greater than $k$?
If an upper bound for $n$ is known as $N$, can $k$ be chosen to be less than $logN$?
algorithm-analysis runtime-analysis amortized-analysis
$endgroup$
add a comment |
$begingroup$
I have a data structure that can perform a task $T$ in constant time, $O(1)$. However, every $k$th invocation requires $O(logn)$, where $k$ is constant.
Is it possible for this task to ever take amortized constant time, or is it impossible because the logarithm will eventually become greater than $k$?
If an upper bound for $n$ is known as $N$, can $k$ be chosen to be less than $logN$?
algorithm-analysis runtime-analysis amortized-analysis
$endgroup$
2
$begingroup$
It depends on how $k$ relates to $n$. For instance $k=2$ then this will not matter and $n$ operations will take $O(n log n)$. If $k = n$ then after $n$ operations we have time $O(n + log n)$. How does $k$ relate to $n$?
$endgroup$
– ryan
Apr 14 at 20:09
$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
Apr 14 at 21:04
add a comment |
$begingroup$
I have a data structure that can perform a task $T$ in constant time, $O(1)$. However, every $k$th invocation requires $O(logn)$, where $k$ is constant.
Is it possible for this task to ever take amortized constant time, or is it impossible because the logarithm will eventually become greater than $k$?
If an upper bound for $n$ is known as $N$, can $k$ be chosen to be less than $logN$?
algorithm-analysis runtime-analysis amortized-analysis
$endgroup$
I have a data structure that can perform a task $T$ in constant time, $O(1)$. However, every $k$th invocation requires $O(logn)$, where $k$ is constant.
Is it possible for this task to ever take amortized constant time, or is it impossible because the logarithm will eventually become greater than $k$?
If an upper bound for $n$ is known as $N$, can $k$ be chosen to be less than $logN$?
algorithm-analysis runtime-analysis amortized-analysis
algorithm-analysis runtime-analysis amortized-analysis
edited Apr 14 at 21:06
rtheunissen
asked Apr 14 at 19:13
rtheunissenrtheunissen
1394
1394
2
$begingroup$
It depends on how $k$ relates to $n$. For instance $k=2$ then this will not matter and $n$ operations will take $O(n log n)$. If $k = n$ then after $n$ operations we have time $O(n + log n)$. How does $k$ relate to $n$?
$endgroup$
– ryan
Apr 14 at 20:09
$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
Apr 14 at 21:04
add a comment |
2
$begingroup$
It depends on how $k$ relates to $n$. For instance $k=2$ then this will not matter and $n$ operations will take $O(n log n)$. If $k = n$ then after $n$ operations we have time $O(n + log n)$. How does $k$ relate to $n$?
$endgroup$
– ryan
Apr 14 at 20:09
$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
Apr 14 at 21:04
2
2
$begingroup$
It depends on how $k$ relates to $n$. For instance $k=2$ then this will not matter and $n$ operations will take $O(n log n)$. If $k = n$ then after $n$ operations we have time $O(n + log n)$. How does $k$ relate to $n$?
$endgroup$
– ryan
Apr 14 at 20:09
$begingroup$
It depends on how $k$ relates to $n$. For instance $k=2$ then this will not matter and $n$ operations will take $O(n log n)$. If $k = n$ then after $n$ operations we have time $O(n + log n)$. How does $k$ relate to $n$?
$endgroup$
– ryan
Apr 14 at 20:09
$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
Apr 14 at 21:04
$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
Apr 14 at 21:04
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
If every $k$th operation takes $O(log n)$ time, then the best bound you can get on the amortized complexity is $O(1 + fraclog nk)$. This follows from the definition of amortized complexity.
$endgroup$
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
8
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "419"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f106957%2fcomplexity-of-many-constant-time-steps-with-occasional-logarithmic-steps%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
If every $k$th operation takes $O(log n)$ time, then the best bound you can get on the amortized complexity is $O(1 + fraclog nk)$. This follows from the definition of amortized complexity.
$endgroup$
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
8
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
add a comment |
$begingroup$
If every $k$th operation takes $O(log n)$ time, then the best bound you can get on the amortized complexity is $O(1 + fraclog nk)$. This follows from the definition of amortized complexity.
$endgroup$
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
8
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
add a comment |
$begingroup$
If every $k$th operation takes $O(log n)$ time, then the best bound you can get on the amortized complexity is $O(1 + fraclog nk)$. This follows from the definition of amortized complexity.
$endgroup$
If every $k$th operation takes $O(log n)$ time, then the best bound you can get on the amortized complexity is $O(1 + fraclog nk)$. This follows from the definition of amortized complexity.
answered Apr 14 at 20:29
Yuval FilmusYuval Filmus
197k15185349
197k15185349
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
8
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
add a comment |
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
8
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
Apr 14 at 21:05
8
8
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
Apr 14 at 21:07
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
@YuvalFilmus might want to note that this is per step, the overall complexity cannot be better than O(n)
$endgroup$
– Frank Hopkins
Apr 14 at 23:46
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
$begingroup$
Of course, I just mean the cost of the task itself.
$endgroup$
– rtheunissen
Apr 15 at 0:14
add a comment |
Thanks for contributing an answer to Computer Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f106957%2fcomplexity-of-many-constant-time-steps-with-occasional-logarithmic-steps%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
It depends on how $k$ relates to $n$. For instance $k=2$ then this will not matter and $n$ operations will take $O(n log n)$. If $k = n$ then after $n$ operations we have time $O(n + log n)$. How does $k$ relate to $n$?
$endgroup$
– ryan
Apr 14 at 20:09
$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
Apr 14 at 21:04