[gnome-devel-docs/wip/swilmet/prog-guidelines: 2/2] programming-guidelines: time complexity fixes
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-devel-docs/wip/swilmet/prog-guidelines: 2/2] programming-guidelines: time complexity fixes
- Date: Sat, 7 Nov 2015 12:29:37 +0000 (UTC)
commit d46175415708f88355f10dd95280103a3b7e95d9
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Nov 7 13:12:38 2015 +0100
programming-guidelines: time complexity fixes
- O(N^2) is quadratic, not exponential. Exponential is O(2^N).
- Constant factors should be removed, since it's an asymptotic notation.
programming-guidelines/C/glist.page | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/programming-guidelines/C/glist.page b/programming-guidelines/C/glist.page
index 17a4c20..40036fb 100644
--- a/programming-guidelines/C/glist.page
+++ b/programming-guidelines/C/glist.page
@@ -61,8 +61,8 @@ for (l = some_list; l != NULL; l = l->next)
}</code>
<p>
- Using an incrementing index instead results in an exponential decrease in
- performance (<em>O(2×N^2)</em> rather than <em>O(N)</em>):
+ Using an incrementing index instead results in a quadratic decrease in
+ performance (<em>O(N^2)</em> rather than <em>O(N)</em>):
</p>
<code mime="text/x-csrc" style="invalid">GList *some_list;
guint i;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]