• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How many forms of indexing are there?

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
IDK. Some people say there is. Some others don't actually de-index and stack indexes from 0 to infinity, IDK what's the difference?
This is the difference between Normal Indexing and Dynamic Indexing.
Never heard of Arrayed Indexing before though.
Here's my understandings;

Dynamic Indexing
An indexing method that de-index the indexes so it won't run to infinity (8191)

Arrayed Indexing
???

Linked List
Some says it performs better than Dynamic Indexing but not most of the time.

Indexing
Does not de-index the indexes.

Hashtable
Uses 2D Array.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
First of all, choosing to use a linked list over arrays are done because the application requires efficient re-ordering of data, or simply put, they are using an ordered list. It's not faster (or more efficient) than arrays for all purposes.

Linked list is a data structure, like a real list on paper, the advantage over arrays is it's constant time removal and insertion of items, while keeping the said items in order. You can't randomly access an element though, you'll have to iterate through the list to find the one you're looking for (sequential access).

Arrays is also a data structure, data is stored on a contiguous arrangement. You can randomly access data, but you'll have to re-order the items on the array to maintain it's continuity.

Hash Tables, is also a data structure, it indexes data by using a hash function. A hash function maps the data to be stored using an algorithm.

Indexing has many definitions, but for wc3 scripting, refers to the technique that utilizes an integer to access an element of an array.

Dynamic Indexing, I think, is a made up term, for use to quickly identify the technique used by Trigger users to efficiently use arrays.

Arrayed Index, seems like a redundant term for Arrays, since arrays require the use of index to function.

Why are you asking for a list of indexing methods?
 
Dynamic Indexing is different than I'Arr. Dynamic Indexing Template was published by Hanky ^^. It is better to use I'Arr. This spell is using dynamic indexing Chain Storm Bolt

Broken link. Kindly differentiate between the two. The template by Hanky.. I don't see any difference.

Something tells me that someone deleted their post linking to Maker's thread. In that thread, Maker stated that dynamic indexing's CurrentIndex is set to the MaxIndex. Is that not what is stated in DIMF's tutorial?
 
Indexed Array*

Refers to an array similar to a vector, where, when an element is removed, the last element is placed into the removed element's position to plug the hole.

This is different from a list, which shifts all of the elements down to plug the hole.

This is also different from a linked list, which utilizes nodes that point to each other rather than a contiguous set of data.



As for all of this indexing garbage, let's get a few things clear

Indexing, as far as I can tell, for a GUI user, is just about using a counter and an indexed array. There is the only kind of indexing there is. All of these other things you are talking about don't exist. When you index, you are doing just what I described.

Indexing like this ensures that every value is unique. However, there are some drawbacks. Let's say that the data you are moving is made up of 5 integers, like 5 variables. If you were to use an indexed array for that, you'd have to move all 5 values. That would suck ; o.

This is where we get into pointers and stack allocation/deallocation. Rather than having these 5 integers, you allocate 1 integer and you have it point to an index across 5 arrays. Now you can put that single pointer into an indexed array or whatever else you want.

Look in my signature at Data Structures.

We use a linked stack for single memory allocation. If you want scratch memory, you use an array stack. If you want to allocate blocks of memory and it's not temporary, you use a heap.


So let's drop all of this indexing nonsense. The only indexing I can think of are hashes and BSTs.

edit
Also keep in mind that indexed arrays are a pure wc3 bs term. An indexed array is simply an array that takes an index, lol.

edit
Here is more on this stuff

http://www.hiveworkshop.com/forums/...array-linked-list-stack-queue-dequeue-188528/

I guess the term indexed array arose because all indices are valid (no holes), but that still doesn't make sense as a plain array list would still be considered to be an array that will never have holes in it.

edit
We also have the collections index

http://www.hiveworkshop.com/forums/jass-resources-412/collections-index-239205/
 
Level 11
Joined
Aug 6, 2009
Messages
697
Indexed Array*

Refers to an array similar to a vector, where, when an element is removed, the last element is placed into the removed element's position to plug the hole.

This is different from a list, which shifts all of the elements down to plug the hole.

This is also different from a linked list, which utilizes nodes that point to each other rather than a contiguous set of data.



As for all of this indexing garbage, let's get a few things clear

Indexing, as far as I can tell, for a GUI user, is just about using a counter and an indexed array. There is the only kind of indexing there is. All of these other things you are talking about don't exist. When you index, you are doing just what I described.

Indexing like this ensures that every value is unique. However, there are some drawbacks. Let's say that the data you are moving is made up of 5 integers, like 5 variables. If you were to use an indexed array for that, you'd have to move all 5 values. That would suck ; o.

This is where we get into pointers and stack allocation/deallocation. Rather than having these 5 integers, you allocate 1 integer and you have it point to an index across 5 arrays. Now you can put that single pointer into an indexed array or whatever else you want.

Look in my signature at Data Structures.

We use a linked stack for single memory allocation. If you want scratch memory, you use an array stack. If you want to allocate blocks of memory and it's not temporary, you use a heap.


So let's drop all of this indexing nonsense. The only indexing I can think of are hashes and BSTs.

edit
Also keep in mind that indexed arrays are a pure wc3 bs term. An indexed array is simply an array that takes an index, lol.

edit
Here is more on this stuff

Introduction to Collections: Index Array, Linked List, Stack, Queue, Dequeue

I guess the term indexed array arose because all indices are valid (no holes), but that still doesn't make sense as a plain array list would still be considered to be an array that will never have holes in it.

edit
We also have the collections index

Collections Index
__________________

Can we switch brains?
 
I'm really confused by deathismyfriend's tutorial, he shows how to use dynamic indexing but calls it Indexed Arrays.

Dynamic indexing and indexed arrays are similar. But there difference is in how you index and de-index.

Indexed arrays move instances around when you de-index.
Dynamic indexing uses an integer array as a pointer to an index.
 
Status
Not open for further replies.
Top