• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Indexed Array, or...?

Status
Not open for further replies.
Level 31
Joined
Jul 10, 2007
Messages
6,306
One thing that has bothered me a great deal is how we've been incorrectly using the term "indexed array" to represent the following algorithm


insert:
set array[count] = value
set count = count + 1

remove:
set count = count - 1
set array[index] = array[count]


An indexed array is just a standard array. The above, for some unknown reason, is called indexing. It is a form of collection.

In reality, it has no name. It is used in the Knuth (Fisher–Yates) shuffle (look it up on wikipedia). For now, we'll just call it the idea used in the Knuth (Fisher–Yates) shuffle.


Does anyone have any good sensible name that we can use for this? Indexed Array is just... it makes us sound stupid : |.


The next thing is ofc all of the so called "indexers" that we have, like a unit indexer. Now, these make sense because they assign array indexes to a handle or w/e. Indexing would just be the act of assigning an index (no matter how) to something. This could be one with a counter, a stack, or whatever else. Indexing doesn't really give any specific information.


When people say that they are indexing something, they could be using the idea used in the Knuth (Fisher–Yates) shuffle or they could be using a stack. I suppose that the method does not really matter, so long as a unique index is assigned.



Back to the original issue. What should we call the unnamed data structure? I am almost positive that it had some name that was issued to it when I was taking a data structures class, but I can't find that name anywhere on the net. 99.99% of people shift elements down when they remove from the array. It's very rare to do what we do here all the time.

Anyways, please share your thoughts =).
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
This post is pretty far above my pay grade but I thought the community has settled on calling it "Dynamic Indexing"? If I'm totally mistaken and misunderstanding please excuse my ignorance. However, if this also is a poor name that does not signify what is actually happening how about calling it:

"Enumerated Arrays", because are we not going through the whole array and doing actions per instance?

Again sorry if I'm actually clueless.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I'd call that a stacked data arrays, since the insert and remove operations looks like a stack to me. I've been calling it that ever since I started scripting in vjass. I myself was confused the first time I heard this term, since I jumped straight to jass when I started making map triggers.

It's been called that for years, the transition will surely cause confusion. I wonder why they didn't bother with correcting the terminology used...
 
Status
Not open for further replies.
Top