aboutsummaryrefslogtreecommitdiff
path: root/src/AMRPlus/ordarrays.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/AMRPlus/ordarrays.h')
-rw-r--r--src/AMRPlus/ordarrays.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/AMRPlus/ordarrays.h b/src/AMRPlus/ordarrays.h
new file mode 100644
index 0000000..b830984
--- /dev/null
+++ b/src/AMRPlus/ordarrays.h
@@ -0,0 +1,23 @@
+#include "arrays.h"
+
+
+
+template <class X>
+class flexset : private array<X>{
+ public:
+ ordarray(): array<X>(){};
+ ~ordarray(){};
+ int insert(const X &elt){
+ int a=0, b=getLength()-1;
+ X* data=this->getData(0);
+ if (elt==data[0]) this->insertElement(elt, 0);
+ if (elt==data[b]) insertElement(elt, b);
+ int c=(a+b)/2;
+ while (elt!=data[c]){
+ if (a==b) {insertElement(elt, a); return a;}
+ if (elt<data[c])
+ }
+
+ };
+
+};