@@ -5,21 +5,35 @@ An [array] is a collection of values, stored contiguously.<br>
5
5
📰 [ Docs] ( https://nodef.github.io/extra-array/ ) ,
6
6
📘 [ Wiki] ( https://github.com/nodef/extra-array/wiki/ ) .
7
7
8
- This package includes common array functions related to querying ** about**
9
- arrays, ** generating** them, ** comparing** one with another, finding their
10
- ** length** , ** getting** and ** setting** elements, obtaining its ** properties** ,
11
- getting a ** part** of it, ** rearranging** elements in it, ** finding** an element
12
- of a subset of elements in it, performing ** functional** operations,
13
- ** manipulating** it in various ways, ** combining** together arrays or its
14
- elements, of performing ** set operations** upon it.
8
+ ![ ] ( https://i.imgur.com/46wYtxW.png )
15
9
16
- All functions except ` from*() ` take array as 1st parameter. Methods like
17
- ` swap() ` are pure and do not modify the array itself, while methods like
18
- ` swap$() ` * do modify (update)* the array itself. Some methods accept a map
19
- function for * faster comparision* (like [ unique] ). I find the map-approach
20
- beautiful, which I learned from Haskell's ` sortOn() ` . You can notice that I have
21
- followed Javascript naming scheme as far as possible. Some names are borrowed
22
- from Haskell, Python, Java, Processing.
10
+ <br >
11
+
12
+
13
+ This package includes comprehensive set of array functions for ** generating** an
14
+ array, ** cloning** them, querying ** about** them, getting non-negative
15
+ ** indices** , managing its ** length** , ** getting/setting** elements, fully or
16
+ partially ** sorting** them, obtaining ** minimum(s)/maximum(s)** , ** comparing**
17
+ one with another, getting a ** part** of it, ** searching a value** , obtaining all
18
+ possible ** arrangements** or ** random arrangements** , ** finding** an element,
19
+ ** taking/dropping** elements or ** scanning** from the begining or end the of an
20
+ array, ** searching** the index of a part of the array, performing ** functional**
21
+ operations, ** flattening** multi-level arrays, obtaining ** prefix sum** ,
22
+ ** manipulating** it in various ways, ** counting/partitioning** elements,
23
+ ** splitting** it, ** concatenating/joining** multiple arrays, ** rearranging**
24
+ elements withing it, or performing ** set operations** upon it. You can use our
25
+ package in a variety of ways to streamline your development process and simplify
26
+ the implementation of complex algorithms.
27
+
28
+ We use a consistent naming scheme that helps you quickly identify the functions
29
+ you need. All functions except ` from*() ` take array as 1st parameter. Some
30
+ functions operate on a specified range in the array, and are called ` ranged*() ` .
31
+ Functions like ` swap() ` are pure and do not modify the array itself, while
32
+ functions like ` swap$() ` * do modify (update)* the array itself. Some functions
33
+ accept a map function for * faster comparision* , such as ` unique() ` . Furher,
34
+ functions which return an iterable instead of an array are prefixed with ` i ` ,
35
+ such as ` isubsequences() ` . We borrow some names from other programming languages
36
+ such as * Haskell* , * Python* , * Java* , and * Processing* .
23
37
24
38
This package is available in * Node.js* and * Web* formats. To use it on the web,
25
39
simply use the ` extra_array ` global variable after loading with a ` <script> `
@@ -43,11 +57,11 @@ xarray.get(x, -1);
43
57
44
58
var x = [1 , 2 , 3 , 4 ];
45
59
xarray .swap (x, 0 , 1 );
46
- // → [2, 1, 3, 4]
60
+ // → [ 2, 1, 3, 4 ]
47
61
48
62
var x = [1 , 2 , 3 , 4 ];
49
63
xarray .rotate (x, 1 );
50
- // → [4, 1, 2, 3 ]
64
+ // → [ 2, 3, 4, 1 ]
51
65
52
66
xarray .permutations ([1 , 2 , 3 ]);
53
67
// → [
@@ -66,6 +80,7 @@ xarray.permutations([1, 2, 3]);
66
80
<br >
67
81
68
82
83
+
69
84
## Index
70
85
71
86
| Property | Description |
@@ -83,9 +98,6 @@ xarray.permutations([1, 2, 3]);
83
98
| [ keys] | Obtain all indices. |
84
99
| [ values] | Get all values. |
85
100
| [ entries] | Obtain all index-value pairs. |
86
- | [ ikeys] | List all indices. |
87
- | [ ivalues] | List all values. |
88
- | [ ientries] | List all index-value pairs. |
89
101
| | |
90
102
| [ index] | Get zero-based index for an element in array. |
91
103
| [ indexRange] | Get zero-based index range for part of array. |
@@ -115,12 +127,8 @@ xarray.permutations([1, 2, 3]);
115
127
| [ searchUnsortedValue] | Find first index of an unsorted value. |
116
128
| [ sort] | Arrange values in order. |
117
129
| [ sort$] | Arrange values in order! |
118
- | [ sortRange] | Arrange a range of values in order. |
119
- | [ sortRange$] | Arrange a range of values in order! |
120
130
| [ partialSort] | Partially arrange values in order. |
121
131
| [ partialSort$] | Partially arrange values in order! |
122
- | [ partialSortRange] | Partially arrange a range of values in order. |
123
- | [ partialSortRange$] | Partially arrange a range of values in order! |
124
132
| | |
125
133
| [ minimum] | Find first smallest value. |
126
134
| [ minimumEntry] | Find first smallest entry. |
@@ -166,11 +174,6 @@ xarray.permutations([1, 2, 3]);
166
174
| [ infixes] | Obtain all possible infixes. |
167
175
| [ subsequences] | Obtain all possible subsequences. |
168
176
| [ permutations] | Obtain all possible permutations. |
169
- | [ iprefixes] | List all possible prefixes. |
170
- | [ isuffixes] | List all possible suffixes. |
171
- | [ iinfixes] | List all possible infixes. |
172
- | [ isubsequences] | List all possible subsequences. |
173
- | [ ipermutations] | List all possible permutations. |
174
177
| [ searchInfix] | Find first index of an infix. |
175
178
| [ searchInfixRight] | Find last index of an infix. |
176
179
| [ searchInfixAll] | Find indices of an infix. |
@@ -325,9 +328,6 @@ xarray.permutations([1, 2, 3]);
325
328
[ keys ] : https://github.com/nodef/extra-array/wiki/keys
326
329
[ values ] : https://github.com/nodef/extra-array/wiki/values
327
330
[ entries ] : https://github.com/nodef/extra-array/wiki/entries
328
- [ ikeys ] : https://github.com/nodef/extra-array/wiki/ikeys
329
- [ ivalues ] : https://github.com/nodef/extra-array/wiki/ivalues
330
- [ ientries ] : https://github.com/nodef/extra-array/wiki/ientries
331
331
[ index ] : https://github.com/nodef/extra-array/wiki/index
332
332
[ indexRange ] : https://github.com/nodef/extra-array/wiki/indexRange
333
333
[ isEmpty ] : https://github.com/nodef/extra-array/wiki/isEmpty
@@ -353,12 +353,8 @@ xarray.permutations([1, 2, 3]);
353
353
[ searchUnsortedValue ] : https://github.com/nodef/extra-array/wiki/searchUnsortedValue
354
354
[ sort ] : https://github.com/nodef/extra-array/wiki/sort
355
355
[ sort$ ] : https://github.com/nodef/extra-array/wiki/sort$
356
- [ sortRange ] : https://github.com/nodef/extra-array/wiki/sortRange
357
- [ sortRange$ ] : https://github.com/nodef/extra-array/wiki/sortRange$
358
356
[ partialSort ] : https://github.com/nodef/extra-array/wiki/partialSort
359
357
[ partialSort$ ] : https://github.com/nodef/extra-array/wiki/partialSort$
360
- [ partialSortRange ] : https://github.com/nodef/extra-array/wiki/partialSortRange
361
- [ partialSortRange$ ] : https://github.com/nodef/extra-array/wiki/partialSortRange$
362
358
[ minimum ] : https://github.com/nodef/extra-array/wiki/minimum
363
359
[ minimumEntry ] : https://github.com/nodef/extra-array/wiki/minimumEntry
364
360
[ maximum ] : https://github.com/nodef/extra-array/wiki/maximum
@@ -399,11 +395,6 @@ xarray.permutations([1, 2, 3]);
399
395
[ infixes ] : https://github.com/nodef/extra-array/wiki/infixes
400
396
[ subsequences ] : https://github.com/nodef/extra-array/wiki/subsequences
401
397
[ permutations ] : https://github.com/nodef/extra-array/wiki/permutations
402
- [ iprefixes ] : https://github.com/nodef/extra-array/wiki/iprefixes
403
- [ isuffixes ] : https://github.com/nodef/extra-array/wiki/isuffixes
404
- [ iinfixes ] : https://github.com/nodef/extra-array/wiki/iinfixes
405
- [ isubsequences ] : https://github.com/nodef/extra-array/wiki/isubsequences
406
- [ ipermutations ] : https://github.com/nodef/extra-array/wiki/ipermutations
407
398
[ searchInfix ] : https://github.com/nodef/extra-array/wiki/searchInfix
408
399
[ searchInfixRight ] : https://github.com/nodef/extra-array/wiki/searchInfixRight
409
400
[ searchInfixAll ] : https://github.com/nodef/extra-array/wiki/searchInfixAll
0 commit comments