Tagged Questions
2
votes
2answers
54 views
Two-dimensional array allocation in Go
I am creating a two-dimensional array, which I am going to process later in ways similar to image MinFilter, procedural labyrinth generation, etc. -- implying using coordinates and neighbors.
Here ...
4
votes
1answer
1k views
Partitioning array elements into two subsets
Problem:
Given a randomly ordered array of n-elements, partition the elements
into two subsets such that elements <= x are in one subset and elements
x are in the other subset.
...
0
votes
1answer
131 views
Find the mean of the medians of two equal sized sorted arrays [closed]
A corrected solution is found here
Looking for code review, clever optimizations, adherence to best practices. etc.
As an example:
a1[1, 3, 5, 7]
a2[2, 4, 6, 8]
The median for each array is the ...
2
votes
1answer
128 views
4
votes
2answers
339 views
Optimising a Data Structure
I have the following 'custom' tree data structure that I am unsure how to classify.
This concept was to be thought of as, if given ("abb", 20) and ...
0
votes
1answer
85 views
2D Array: Retrieve the “Left” Item
I am creating a game that contains a Board and Pieces. The Board is basically a 2D array of Pieces. [Think smaller chess board]
One of the things that I want to accomplish is to be able to retrieve ...
5
votes
1answer
159 views
Sparse Bitarray Class in Python (or rather frequently having contiguous elements with the same value)
Sparse is probably the wrong word - this is for encoding arrays of booleans where contiguous values tend to be the same. It'd be great to know a proper name for this data structure so I could read ...
6
votes
2answers
1k views
Find all single elements in an array
I am interested in printing all numbers that do not have a match in an array.
Example: 1,3,4,5,3,4,5,5,6 result 1,5,6
Please ...