# Time complexity of one algorithm cascaded into another?

**URL:** <https://discuss.elastic.co/t/time-complexity-of-one-algorithm-cascaded-into-another/13543>\
**Category:** Elasticsearch\
**Created:** [September 10, 2013, 7:54pm UTC](https://discuss.elastic.co/t/time-complexity-of-one-algorithm-cascaded-into-another/13543 "2013-09-10T19:54:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric\_3](https://avatars.discourse-cdn.com/v4/letter/e/b487fb/32.png) [@eric\_3](https://discuss.elastic.co/u/eric_3)\
**Post date:** [September 10, 2013, 7:54pm UTC](https://discuss.elastic.co/t/time-complexity-of-one-algorithm-cascaded-into-another/13543/1 "2013-09-10T19:54:19Z")

</div>

I am working with random forest for a supervised classification problem,  
and I am using the k-means clustering algorithm to split the data at each  
node. I am trying to calculate the time complexity for the algorithm. From  
what I understand the the time complexity for k-means is O( n \* K \* I \* d )  
– n = number of points, K = number of clusters, I = number of iterations, d  
= number of attributes. The k, I and d are constants or have an upper  
bound, and n is much larger as compared to these three , so i suppose the  
complexity is just O(n). The random forest on the other hand is a divide  
and conquer approach , so for n instances the complexity is O(n\* logn),  
though I am not sure about this, correct me if i am wrong. To get the  
complexity of the algorithm do i just add these two things?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:17am UTC](https://discuss.elastic.co/t/time-complexity-of-one-algorithm-cascaded-into-another/13543/2 "2017-07-06T02:17:13Z")

</div>

Closed on July 6, 2017, 2:17am UTC


