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.

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 ...
Greg's user avatar
  • 549
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. ...
Greg's user avatar
  • 549
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): ...
einpoklum's user avatar
  • 2,099
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 <...
NeKon's user avatar
  • 641
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: ...
Raghav Malik's user avatar
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. ...
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
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.: ...
michael.zech's user avatar
  • 5,044
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 ...
coderodde's user avatar
  • 31.9k
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: ...
michael.zech's user avatar
  • 5,044
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 ...
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
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 ...
Zak's user avatar
  • 241
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: ...
michael.zech's user avatar
  • 5,044
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 ...
CrSb0001's user avatar
  • 619

15 30 50 per page
1
2 3 4 5
142