You can do it if you have 3 arrays:
- The actual values (can be integers or strings or units or whatever).
- The position of the next element in the list (must be integers).
- An array of all the "open" positions in the previous arrays. This is needed to recycle the linked lists (must be integers). You will also need an integer to keep track of the number of valid open position. So for example if you have 3 free spot then the first (or, depending on your implementation, last) 3 elements in these arrays are free to use when someone needs to create a new linked list or add elements to an existing linked list.
Example with strings (I show arrays of length 4 with each of the elements separated by a ','):
["e", "q", "H", "y"]
[3, 2, 0, -1]
[1, -1, -1, -1] (Free spots: 1)
This would mean that you have a linked list at location 2, namely "Hey". You start at "H", next location is location 0 which is "e", next location is 3 which is "y", the -1 means that "y" is the last one in the list.
The location of "q" is free (there should be no "reference" to this location at this moment).
As long as you create the arrays to be big enough and you aren't scared to do your own little memory management, you can make your linked lists like this.