Complexity of many constant time steps with occasional logarithmic steps Planned maintenance scheduled April 17/18, 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

Multi tool use
Multi tool use

How is simplicity better than precision and clarity in prose?

What's the point in a preamp?

Two different pronunciation of "понял"

How can I make names more distinctive without making them longer?

Aligning matrix of nodes with grid

Why don't the Weasley twins use magic outside of school if the Trace can only find the location of spells cast?

How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time

How to colour the US map with Yellow, Green, Red and Blue to minimize the number of states with the colour of Green

What to do with post with dry rot?

Is there a documented rationale why the House Ways and Means chairman can demand tax info?

Losing the Initialization Vector in Cipher Block Chaining

What are the performance impacts of 'functional' Rust?

Would an alien lifeform be able to achieve space travel if lacking in vision?

Estimated State payment too big --> money back; + 2018 Tax Reform

Cold is to Refrigerator as warm is to?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

Can't figure this one out.. What is the missing box?

Determine whether f is a function, an injection, a surjection

Why is "Captain Marvel" translated as male in Portugal?

How to retrograde a note sequence in Finale?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Single author papers against my advisor's will?

Windows 10: How to Lock (not sleep) laptop on lid close?

I'm thinking of a number



Complexity of many constant time steps with occasional logarithmic steps



Planned maintenance scheduled April 17/18, 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










2












$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$?










share|cite|improve this question











$endgroup$







  • 1




    $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
    2 hours ago










  • $begingroup$
    @ryan k is constant. (I have edited the question to specify this)
    $endgroup$
    – rtheunissen
    1 hour ago
















2












$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$?










share|cite|improve this question











$endgroup$







  • 1




    $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
    2 hours ago










  • $begingroup$
    @ryan k is constant. (I have edited the question to specify this)
    $endgroup$
    – rtheunissen
    1 hour ago














2












2








2





$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$?










share|cite|improve this question











$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






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 1 hour ago







rtheunissen

















asked 3 hours ago









rtheunissenrtheunissen

1254




1254







  • 1




    $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
    2 hours ago










  • $begingroup$
    @ryan k is constant. (I have edited the question to specify this)
    $endgroup$
    – rtheunissen
    1 hour ago













  • 1




    $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
    2 hours ago










  • $begingroup$
    @ryan k is constant. (I have edited the question to specify this)
    $endgroup$
    – rtheunissen
    1 hour ago








1




1




$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
2 hours ago




$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
2 hours ago












$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
1 hour ago





$begingroup$
@ryan k is constant. (I have edited the question to specify this)
$endgroup$
– rtheunissen
1 hour ago











1 Answer
1






active

oldest

votes


















4












$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.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
    $endgroup$
    – rtheunissen
    1 hour ago






  • 5




    $begingroup$
    If $k$ is constant, the amortized complexity is $O(log n)$.
    $endgroup$
    – Yuval Filmus
    1 hour ago











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
);



);













draft saved

draft discarded


















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









4












$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.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
    $endgroup$
    – rtheunissen
    1 hour ago






  • 5




    $begingroup$
    If $k$ is constant, the amortized complexity is $O(log n)$.
    $endgroup$
    – Yuval Filmus
    1 hour ago















4












$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.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
    $endgroup$
    – rtheunissen
    1 hour ago






  • 5




    $begingroup$
    If $k$ is constant, the amortized complexity is $O(log n)$.
    $endgroup$
    – Yuval Filmus
    1 hour ago













4












4








4





$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.






share|cite|improve this answer









$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.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered 2 hours ago









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
    1 hour ago






  • 5




    $begingroup$
    If $k$ is constant, the amortized complexity is $O(log n)$.
    $endgroup$
    – Yuval Filmus
    1 hour ago
















  • $begingroup$
    Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
    $endgroup$
    – rtheunissen
    1 hour ago






  • 5




    $begingroup$
    If $k$ is constant, the amortized complexity is $O(log n)$.
    $endgroup$
    – Yuval Filmus
    1 hour ago















$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
1 hour ago




$begingroup$
Does that mean that if k is constant, the amortized complexity is O(1 + (log n / k))?
$endgroup$
– rtheunissen
1 hour ago




5




5




$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
1 hour ago




$begingroup$
If $k$ is constant, the amortized complexity is $O(log n)$.
$endgroup$
– Yuval Filmus
1 hour ago

















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







PWsABac,Lv72,4 Uzy 0OFU,N90lcJT7b
Y9MnD vG ldNBh 0sJ8,jhj2295sSkK,w

Popular posts from this blog

What is the result of assigning to std::vector::begin()? The Next CEO of Stack OverflowWhat are the differences between a pointer variable and a reference variable in C++?What does the explicit keyword mean?Concatenating two std::vectorsHow to find out if an item is present in a std::vector?Why is “using namespace std” considered bad practice?What is the “-->” operator in C++?What is the easiest way to initialize a std::vector with hardcoded elements?What is The Rule of Three?What are the basic rules and idioms for operator overloading?Why are std::begin and std::end “not memory safe”?

Creating centerline of river in QGIS? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Finding centrelines from polygons in QGIS?Splitting line into two lines with GRASS GIS?Centroid of the equator and a pointpostgis: problems creating flow direction polyline; not all needed connections are drawnhow to make decent sense from scattered river depth measurementsQGIS Interpolation on Curved Grid (River DEMs)How to create automatic parking baysShortest path creation between two linesclipping layer using query builder in QGISFinding which side of closest polyline point lies on in QGIS?Create centerline from multi-digitized roadway lines Qgis 2.18Getting bathymetric contours confined only within river banks using QGIS?

SQL Server 2016 - excessive memory grant warning on poor performing query The Next CEO of Stack OverflowFix for slow SQL_INLINE_TABLE_VALUED_FUNCTIONLarge memory grant requestsPoor performing Query -Tsql execution plan - estimated number of rows =1 Paste the PlanMSSQL - Query had to wait for memory grantRow estimates always too lowBad performance using “NOT IN”Warning about memory “Excessive Grant” in the query plan - how to find out what is causing it?Optimizing table valued function SQL ServerWhen does SQL Server warn about an Excessive Memory Grant?Warning in Execution Plan