All Questions
Tagged with comparative-review array
27
questions
3
votes
1
answer
47
views
Comparing a set of parameters contained in two separate strings in Powershell
I have a situation where I need to compare two strings with each other in a foreach loop that potentially run over millions of rows of data. The two strings will always contain between 1 and 12 ...
4
votes
1
answer
163
views
Array Implementation In JavaScript
Review
I have written my own implementation of Array in JavaScript with the basic functionalities. Can anyone please review this code and point out the mistakes/how to make the implementation better?
...
1
vote
1
answer
97
views
Selection algorithms (order statistic) in Java: linear time vs. sorting selector vs. Quickselect
This post is about computing order statistics: given an array \$A\$ (not necessarily sorted), find the \$k\$th smallest array component. The entire repository is here.
...
2
votes
1
answer
690
views
=PRINTF("{1} - {2}", ... ) in Excel without VBA - LAMBDA functions with variable number of arguments
The TEXTJOIN function has a really nice interface:
=TEXTJOIN(delimiter, ignore_empty, text1, [text2], …, [text252])
... where ...
1
vote
1
answer
402
views
Perform various actions on a list
I am solving the following HackerRank problem:
Consider a list (list = []). You can perform the following commands:
insert i e: Insert integer e at position i.
<...
4
votes
2
answers
11k
views
Convert array of u32 to Vec<u8> in Rust
In Rust, I want to take an array of u32 values, convert each to four bytes in big endian, and concatenate them to yield a ...
0
votes
2
answers
171
views
Union of two double arrays
I would like to merge two double arrays and remove from the result array approximately equal items.
My two input arrays have ...
6
votes
1
answer
245
views
EEPROM-based filesystem, aiming for Misra C++ 2008 compliance
I'm writing code for embedded systems (IAR compiler) and it should adhere to Misra C++ 2008. This limits the available features of the language quite a bit:
no C++1x features
use of the standard ...
6
votes
2
answers
137
views
Concatenating prefix of one array with the reversed suffix of another array
Given two arrays and two indices, I need to concatenate the prefix of the first array and the reversed prefix of the second array.
For example:
...
2
votes
2
answers
86
views
Copying and filtering Ruby arrays
I'm doing a Ruby exercise to create new arrays with a given filter.
Copy the values less than 4 in the array stored in the source variable
into the array in ...
5
votes
3
answers
100
views
Aggregate summary counts for an array of error objects
I'm doing some refactoring of someone else's code, and just want a second opinion, because of course I think my work makes it better, but some validation (or correction) would be helpful.
Starting ...
0
votes
1
answer
594
views
Foreach vs Iterator [closed]
I have implemented a trim method which removes objects having empty properties.
This list has average size of 3 or so. Probably, the max length is 7 or 8.
I ...
6
votes
2
answers
1k
views
Apply function to array of decimals
I am writing some code to transform an array of decimals so that they are discounted over time.
I initially wrote the following code:
...
-2
votes
1
answer
104
views
Code duplication vs wordiness
In my program I read values from a configuration array.
First I just used magic constants like this:
...
4
votes
1
answer
90
views
Get sum of an array in 3 ways, for, while and recursive
So i was trying to find sum of an array using 3 ways in perl6
for
while
recursive
(I know there are inbuilt perl6 functions for this)
I want to know if there is a better way to do this or is this ...