Questions tagged [array]
An array is an ordered data structure consisting of a collection of elements (values or variables), each identified by one (single dimensional array, or vector) or multiple indexes.
2,130 questions
0
votes
0
answers
14
views
Indexing into Nested Data Structures in VBA
Project
I have created a VBA module called Idx which you may find here on GitHub. It is inspired by pluck() and ...
1
vote
0
answers
121
views
Collection Utilities for VBA
Background
I am building a complex, standalone class. It has a property called .Mapping, which should behave like a Dictionary.
...
2
votes
2
answers
162
views
Affect a repetition of an argument N times (for array construction)
Consider the following (C++20) function (from the solution to this StackOverflow question):
...
2
votes
1
answer
82
views
RAII Wrapper For CUDA Pointers
I was recently working on my CUDA wrappers library, and this particular class is one of the oldest pieces of code in the entire project. Since that time, I added tons of other features (for example <...
4
votes
2
answers
120
views
Implementing views and slicing for arbitrarily nested `std::vector`s in a header-only library
I implemented a templated vector_view class that holds a reference to an std::vector and provides the following operations:
...
2
votes
1
answer
120
views
Swift: Find neighbor-elements within an array
I need a function which finds the left and right neighbor-element within an integer-array, based upon a given index. If the given element is 0, then it shall return largest index as left neighbor. ...
14
votes
5
answers
2k
views
I implemented FFT in C
I wrote Cooley-Tukey's FFT algorithm in C. And I want to know how safe is this code? Is it just trash? How can I make it more memory safe?
...
3
votes
1
answer
65
views
Ruby Array#own_uniq method
I have implemented my own version of Ruby's Array uniq-method (Ruby docs - Class array) as a monkey patch on Array.
Method-impl.:
...
2
votes
1
answer
110
views
IndexedLinkedList.java - A fast list data structure for large data, Take V/V (the finger list)
Intro
This post is all about so called finger list, which is a data structure for speeding up the
linked-list operations.
Code
...
4
votes
2
answers
247
views
Ruby Array#own_shuffle method
I have tried to implement the Array-shuffle method myself. Haven't had a look on some similar algorithm-examples by purpose and tried to figure out something myself.
The actual Array-extension:
...
1
vote
0
answers
39
views
Identifies connected elements and faces in FE mesh
So I'm conscious that this is a weak appeal for best practices. I'm building a converter that moves generic FE meshes to an inhouse edge format in Fortran and at some point I made a truly diabolical ...
6
votes
7
answers
1k
views
Filter non-even elements from an array
I have a method that returns an int[]. The array is made by filtering out only the even values of the array passed into the method.
It works, but it's really ugly ...
2
votes
1
answer
50
views
Zig: Basic map and movement logic
I'm interested about choice of types for storing coordinates; since the type for indexing an array is usize, that is what I chose. I feel something might be wrong ...
4
votes
1
answer
113
views
Swift Arrays: Write a rotate-right function
Task:
Write a function which rotates all elements of a given array to the right.
Example: [1, 2, 3] => [3, 1, 2]
My solution:
...
2
votes
2
answers
427
views
Median of two sorted arrays in Python
Problem Statement
(Source: Leetcode Problem 4: Median of Two Sorted Arrays [Hard])(Topics: [Array] [Binary Search] [Divide and Conquer])
Given two sorted arrays ...