| | |
linked list..quick question
![]() |
check any of the thousands of explanations on how to implement a linked list that exist.
Basically just point the element before the one that is to be deleted to the one that the element you're deleting is pointing to and set the pointer in that element to null.
or something like that, my pointer code in C is a bit rusty.
Basically just point the element before the one that is to be deleted to the one that the element you're deleting is pointing to and set the pointer in that element to null.
Java Syntax (Toggle Plain Text)
typedef struct ll { int val; ll *next; } ll *list; void addElement(int el) { } void deleteElement(int pos) { // find position // ... ll element = (listCopy->next)*; ll delElement = (element->next)*; element.next = delElement.next; delElement.next = null; }
or something like that, my pointer code in C is a bit rusty.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- Minimal element in a linked list? (Computer Science)
- Circular linked list (C)
- linked list question (C)
- remove method linked list (C)
- Linked List & Objects (C++)
- "doubly linked list" question (C)
Other Threads in the Java Forum
- Previous Thread: Linkedlist Troubles...plz Help
- Next Thread: how to perform calculation
| Thread Tools | Search this Thread |
-xlint add android api applet application array arrays automation bi binary blackberry block bluetooth class client code compile compiler component database developmenthelp digit eclipse error fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image int integer j2me j2seprojects java javac javame javaprojects jetbrains jni jpanel jtable julia learningresources lego linux list login loops mac main map method methods mobile myregfun netbeans nonstatic notdisplaying number online pearl problem program project qt recursion scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor






