Skip to content

JassWeb

  • Home
  • Solved
    • javascript
    • c++
    • java
    • git
    • php
    • arrays
    • html
    • python
    • jquery
    • mysql
    • .net
    • json
    • ajax

analysis

[Solved] Time complexity of recursive algorithm (pseudo code)

October 31, 2022 by Kirat

First, let’s look at two simple nested loops first: for i (1..N) { for j (1..N) { f(); } } for i (1..N) { for j (i..N) { g(); } } f() is called N*N = N2 = O(N2) times. g() is called N+(N-1)+…+5+4+3+2+1 = N(N+1)/2 = N2/2 + N/2 = O(N2) times. As you … Read more

Categories Solved Tags algorithm, analysis, time-complexity

[Solved] What is the Big O complexity for this division algorithm

September 25, 2022 by Kirat

The number of iterations of the while-loop is exactly floor(x/y). Each iteration takes n operations, because that is the complexity of the subtraction r – y. Hence the complexity of the algorithm is n * floor(x/y). However, we want to express the complexity as a function of n, not as a function of x and … Read more

Categories Solved Tags algorithm, analysis, big-o, time-complexity

[Solved] what is the best-case / worst-case analysis for the following loop? [closed]

September 7, 2022 by Kirat

There will be exactly n iterations of the first loop. There will be exactly n(n+1)/2 iterations of the second loop. Inside of the second loop there is roughly 1/3 of n/2 long loops, 1/3 of j long loops and 1/3 of 2 long loops. If we look only at the first of the three possible … Read more

Categories Solved Tags algorithm, analysis, big-o, c++, complexity-theory

[Solved] sequence whose series is convergent, but square is not convergent [closed]

August 29, 2022 by Kirat

How about a_n = (-1)^n / sqrt(n) (source) For positive a_n there is no such sequence. Next time, you might want to ask at math.SE. solved sequence whose series is convergent, but square is not convergent [closed]

Categories Solved Tags analysis, math

Recent Posts

  • [Solved] Check to see if two lists have the same value at the same index, if so return the index. If not return -1
  • [Solved] Generics C# organization of methods that depends on type [closed]
  • [Solved] Database – SQL Table to Perl Script
  • [Solved] Comment xml elements programmatically
  • [Solved] Logging printout of an executed python file within another file and printing out the result in terminal simultaneously

Archives

  • November 2023
  • June 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • November 2021
  • August 2020
  • March 2020
  • June 2019
  • February 2019
  • September 2018
  • August 2018
  • July 2018
  • March 2018
  • February 2018
  • December 2017
  • October 2017
  • August 2017
  • January 2017
  • September 2016
  • May 2016
  • January 2016
  • October 2015
  • July 2015
  • February 2015
  • December 2014
  • November 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • March 2014
  • January 2014
  • January 2013
  • October 2012
  • March 2012
  • October 2011
  • March 2011
  • January 2010
  • September 2009
  • May 2009
  • February 2009
  • January 2009
  • October 2007
  • January 2007
  • November 2004
  • May 2002
  • September 2001
  • May 2001

Categories

  • Solved
  • WordPress

Quick Links

© 2025 JassWeb • Built with GeneratePress