Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Linked List

Archive: 2 posts


How would I create a linked list. For those of you that may not know, a linked list is an array that allows things to be quickly added, removed, or modified. In the list 1,2,3,5 I could easily remove the 2 and add a 4 so that it is now 1,3,4,5. This also results in no gaps between numbers; If I go from 1 to 3 then there will be no empty space between the 1 and the 3. Therefore, I would be able to jump directly from 1 to 3.

I want to be able to create this in the most efficient way. I don't want to have a limit on the number of things that can fit in the list but I would be happy if I could have at least 20-30 things in the list at any given moment.

Here is some information that may help: In a linked list, information is stored in each number. For example, in the list 1,2,3,5 the information that the number 3 should hold is that it is before the number 5 and after the number 2. Since the list is dynamic, the information should change if I add or remove a number. So if I remove the number 2, the number 3 will still know that it is before 5 but it will see that it is now after 1 rather than 2.

I would appreciate it if you left feedback. Thanks!
2012-03-29 02:26:00

Author:
Unknown User


Well, you could make a set of train carts that link together and each cart can hold a number, or you could build a computer that runs java and google for some linked list java source code, but I'm guessing neither is what you want. In order to answer your question we will need to know some more specifics. In fact, it's probably easier if you just posed your problem and asked for a solution, in stead of posing a solution and asking for an implementation without knowing the problem. 2012-03-29 10:57:00

Author:
Rogar
Posts: 2284


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.