11///| Min Max
22
3- ///| Maximum value
3+ ///|
4+ /// Maximum value
45///
56/// # Parameters
67///
@@ -23,7 +24,8 @@ pub fn[T : Compare] max(a : T, b : T) -> T {
2324 }
2425}
2526
26- ///| Minimum value
27+ ///|
28+ /// Minimum value
2729///
2830/// # Parameters
2931///
@@ -46,7 +48,8 @@ pub fn[T : Compare] min(a : T, b : T) -> T {
4648 }
4749}
4850
49- ///| Maximum value in array
51+ ///|
52+ /// Maximum value in array
5053///
5154/// # Parameters
5255///
@@ -70,7 +73,8 @@ pub fn[T : Compare] max_element(data : Array[T]) -> T {
7073 data .fold (init = data [0 ], fn (mx , x ) { if x > mx { x } else { mx } })
7174}
7275
73- ///| Minimum value in array
76+ ///|
77+ /// Minimum value in array
7478///
7579/// # Parameters
7680///
@@ -96,7 +100,8 @@ pub fn[T : Compare] min_element(data : Array[T]) -> T {
96100
97101///| Binary Search
98102
99- ///| Find first index of element in array that not less than value
103+ ///|
104+ /// Find first index of element in array that not less than value
100105///
101106/// # Parameters
102107///
@@ -130,7 +135,8 @@ pub fn[T : Compare] lower_bound(data : Array[T], value : T) -> Int {
130135 first
131136}
132137
133- ///| Find first index of element in array that bigger than value
138+ ///|
139+ /// Find first index of element in array that bigger than value
134140///
135141/// # Parameters
136142///
@@ -163,7 +169,8 @@ pub fn[T : Compare] upper_bound(data : Array[T], value : T) -> Int {
163169 first
164170}
165171
166- ///| Find whether a value in the array
172+ ///|
173+ /// Find whether a value in the array
167174///
168175/// # Parameters
169176///
@@ -185,7 +192,8 @@ pub fn[T : Compare] binary_search(data : Array[T], value : T) -> Bool {
185192 first != data .length () && data [first ] == value
186193}
187194
188- ///| Find range of array equal to value
195+ ///|
196+ /// Find range of array equal to value
189197///
190198/// # Parameters
191199///
@@ -213,7 +221,8 @@ pub fn[T : Compare] equal_range(data : Array[T], value : T) -> (Int, Int) {
213221
214222///| Merge
215223
216- ///| Merge two sorted array in sequence
224+ ///|
225+ /// Merge two sorted array in sequence
217226///
218227/// # Parameters
219228///
@@ -254,7 +263,8 @@ pub fn[T : Compare] merge(data1 : Array[T], data2 : Array[T]) -> Array[T] {
254263 res .iter ().concat (data2 [j :].iter ()).collect ()
255264}
256265
257- ///| Fast Exponentiation
266+ ///|
267+ /// Fast Exponentiation
258268///
259269/// # Parameters
260270///
@@ -290,7 +300,8 @@ pub(all) struct Point {
290300 y : Int
291301} derive (Show )
292302
293- ///| Calculate max manhattan distance
303+ ///|
304+ /// Calculate max manhattan distance
294305///
295306/// # Parameters
296307///
@@ -401,7 +412,8 @@ pub fn ext_euc(a : Int, b : Int) -> (Int, Int, Int) {
401412 }
402413}
403414
404- ///| Calculate Inverse Element
415+ ///|
416+ /// Calculate Inverse Element
405417///
406418/// # Parameters
407419///
0 commit comments