[gnome-devel-docs/wip/swilmet/prog-guidelines: 1/3] programming-guidelines: time complexity fixes



commit f20cff3d28e084c5d8aeb1eabb30ddf38eaeb374
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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757735

 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]