Jump to content

Time complexity for recursive algorithms

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Krews

Krews

    Newbie

  • Members
  • Pip
  • 1 posts
Hello , i'm relativly new to this forum.
I have an algorithm for a insert function that is adapted to a quadtree datastructure.

My functions runs 4 recursion but only one recursion for each run. That is , it has
four recursions calls but they're call is based on conditions that need to be hold.
Ex:

if .. then

recursion

if .. then

recursion

and so on

My question is though, is the time complexity still considered as T(n-1) for every recursive call ?, or is it something else. I find it hard to think that it would be something else though as it only calls for one recursion for each recursion. But i'm a newbie on time complexity too.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Without seeing the code, it'll be VERY hard to determine that. I'm not clear at all what you're logic is doing.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog