Browse Source

Added Almost-Sorted-Distinct

Mike Schwörer 3 years ago
parent
commit
9713a83618
1 changed files with 44 additions and 0 deletions
  1. 44
    0
      Almosted-Sorted-Distinct.b93

+ 44
- 0
Almosted-Sorted-Distinct.b93 View File

@@ -0,0 +1,44 @@
1
+v XX
2
+  YY
3
+>            v
4
+0124445326432
5
+8567899988288
6
+v            <
7
+
8
+
9
+>      94+2* 21p           94+ 31p             v
10
+v                                              <
11
+
12
+
13
+                 >3+g40g1+:31g%\31g/3+p40g:31   v >$$v
14
+    >0pv>20g-  #v v#                 <          #  $_v#`\g03<
15
+    2v0<^:g+3/g< ^ /g13\%g13:g04g+3/g 13\%g13:+1:p04:< >30g-|
16
+>01-^>::31g%\31^ v_$:0\:31g%\3 1g/3+p^>::31g%\31g/3+g::|    $
17
+     ^_v#-g12:+1<>:20g`#v_30p:>1-:1+  |         # ^  $$<    1  
18
+       $        ^      $># 2#  0 p# <$<0  p+3/g13\%g13:\0  +<
19
+       >@                     ^p+3/g13        \%<
20
+
21
+
22
+
23
+:40p:1+:31g%\31g/3+g40g:31g%\31g/      3+g40g1+:31g%\31g/3+p40g:31      g%\31g/3+p
24
+
25
+
26
+
27
+[20] max
28
+[30] search
29
+[40] temp
30
+
31
+[21] arr-size
32
+[31] arr-width
33
+
34
+
35
+
36
+
37
+---------------------------------------
38
+
39
+Almosted Sorted Distinct
40
+========================
41
+
42
+
43
+Replaces all repeated values in an array with zero.
44
+Works best on (almost) sorted lists (otherwise this is O(n^2))

Loading…
Cancel
Save