Skip to main content

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.

1 vote
1 answer
100 views

Benchmarking in Java some super linearithmic sorting algorithms

Intro A sort is called super linearithmic if its running time is \$\omega(N \log N)\$. For example, \$f(N) = \omega(g(N))\$ means that \$f(N)\$ grows "faster" than \$g(N)\$. In this post, I ...
coderodde's user avatar
  • 32k
2 votes
0 answers
125 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 ...
Greg's user avatar
  • 569
1 vote
0 answers
130 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. ...
Greg's user avatar
  • 569
2 votes
2 answers
184 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): ...
einpoklum's user avatar
  • 2,099
2 votes
1 answer
84 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 <...
NeKon's user avatar
  • 641
4 votes
2 answers
123 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: ...
Raghav Malik's user avatar
2 votes
1 answer
123 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. ...
michael.zech's user avatar
  • 5,044
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? ...
RudraSama's user avatar
  • 181
3 votes
1 answer
69 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.: ...
michael.zech's user avatar
  • 5,044
2 votes
1 answer
121 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 ...
coderodde's user avatar
  • 32k
4 votes
2 answers
248 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: ...
michael.zech's user avatar
  • 5,044
1 vote
0 answers
41 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 ...
Subject303's user avatar
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 ...
Otakuwu's user avatar
  • 163
2 votes
1 answer
51 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 ...
Zak's user avatar
  • 241
4 votes
1 answer
115 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: ...
michael.zech's user avatar
  • 5,044

15 30 50 per page
1
2 3 4 5
143