6
votes
Deepest pit of an array
Overall, reading this code, my reaction is "huh?". It looks like a bunch of gibberish at first (and second) glance. There are no english words. I would not want to maintain this code after ...
5
votes
Sum two vectors in x86 assembly
A bug
Using ebx is OK, but like esi and edi it is a callee-save register, so you should save ...
4
votes
Porting PHP's array_push to Python
The list case. As noted in a comment, you can simplify to this:
array.extend(args)
The dict case. It looks like the goal is to find the max integer key, if
any, ...
4
votes
std::array based push-only circular buffer
Missing Includes
It doesn't compile for me without the #include <stdexcept>.
Other stuff is luckily included by other includes. I'm personally a fan of ...
4
votes
std::array based push-only circular buffer
It's missing a lot of features
The parts you have implemented look reasonably OK, but it is missing a lot of features you would expect from a container class. You already mentioned you cannot get a <...
2
votes
Deepest pit of an array
function deepest_pit(B) {
The JavaScript style guide here indicates that camelCase is recommended for functions. JavaScript is ...
1
vote
Sum up nested array of objects based on keys
I'm going to make an up-front assumption that many of the truthy checks you're doing (e.g. ... || 0) is simply to check if a value is undefined or not, and you don'...
1
vote
Accepted
Sum up nested array of objects based on keys
You are returning a new object in each iteration inside the reducers, when you could use just one object for the tallies (see below). The handling of undefined values suggest to me that the underlying ...
1
vote
Porting PHP's array_push to Python
Some points to supplement @FMc's answer (though we'll put aside for the moment its excellent advice against mutation):
The way you compute keys when extending dictionaries can be tidied with ...
1
vote
Suggestions for improvement for generic array and map functions in Go 1.18
Right, I've had a closer look at the Map type you posted here (don't know why, but that one piqued my interest more than the list). There's quite a lot to unpack ...
1
vote
Merge sort in PHP 5
It appears that you have quite a bit of experience with mergesort in various programming languages. While it may obviously be deemed a bit tangential to the purpose of StackOverflow I can’t help but ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
array × 2049java × 491
javascript × 392
performance × 314
algorithm × 236
php × 220
c++ × 203
python × 198
beginner × 173
c × 164
c# × 161
strings × 122
programming-challenge × 104
sorting × 94
object-oriented × 67
ruby × 54
vba × 52
interview-questions × 50
numpy × 44
recursion × 40
ecmascript-6 × 40
hash-map × 38
python-3.x × 37
excel × 37
random × 36