| | |
Deleting Pointed node in Singly Linked List
![]() |
•
•
Join Date: Feb 2006
Posts: 2
Reputation:
Solved Threads: 0
Ya, I know u can shift up the links following the one pointed to. Or u can swap with the last node and delete the last node(If sorted order is not a criteria). But this is an optimisation problem. Consider this as an infinitely long link list. Both the above methods are not practical in such a scenario as both are computational intensive.
Is there any other way??
Is there any other way??
>Ya, I know u can shift up the links following the one pointed to.
Shift? It sounds like you're confused, but we'll proceed.
>Or u can swap with the last node and delete the last node(If
>sorted order is not a criteria).
Sorted order is irrelevant since you're unlinking the node causing disorder anyway. And you don't need to swap unless you're returning the deleted node and need the data in the calling function.
>Both the above methods are not practical in such a scenario
>as both are computational intensive.
Constant time performance with two operations is computationally intensive? The only way to improve that performance is to drop down to inline assembly and optimize the data movement with low level register tricks. Even then you won't see much of an improvement.
You say you understand the solution I was suggesting, but you obviously don't if you think it's "computationally intensive".
Shift? It sounds like you're confused, but we'll proceed.
>Or u can swap with the last node and delete the last node(If
>sorted order is not a criteria).
Sorted order is irrelevant since you're unlinking the node causing disorder anyway. And you don't need to swap unless you're returning the deleted node and need the data in the calling function.
>Both the above methods are not practical in such a scenario
>as both are computational intensive.
Constant time performance with two operations is computationally intensive? The only way to improve that performance is to drop down to inline assembly and optimize the data movement with low level register tricks. Even then you won't see much of an improvement.
You say you understand the solution I was suggesting, but you obviously don't if you think it's "computationally intensive".
I'm here to prove you wrong.
Narue is not so much agressive as frustrated with the lack of effort by many (especially younger) people in this world to even attempt to solve their own problems, an attitude I can very much relate to.
But then we're both professionally employed in this profession and have to work with the end result of an educational cycle in which such lack of effort gets people degrees and diplomas which in turn get them hired to be our colleagues, saddling us with the burden of doing their work to get projects completed.
But then we're both professionally employed in this profession and have to work with the end result of an educational cycle in which such lack of effort gets people degrees and diplomas which in turn get them hired to be our colleagues, saddling us with the burden of doing their work to get projects completed.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
•
•
•
•
Originally Posted by jwenting
Narue is not so much agressive as frustrated with the lack of effort by many (especially younger) people in this world to even attempt to solve their own problems, an attitude I can very much relate to.
But then we're both professionally employed in this profession and have to work with the end result of an educational cycle in which such lack of effort gets people degrees and diplomas which in turn get them hired to be our colleagues, saddling us with the burden of doing their work to get projects completed.
Whilst it is entirely possible that these people can lead socially rewarding lives outside of work I find it difficult to imagine. A happy IT associated person, - are you kidding me? The constraints of life make this unlikely. :lol:
*Voted best profile in the world*
![]() |
Other Threads in the C Forum
- Previous Thread: converting a char array to a single char
- Next Thread: pointer problems
| Thread Tools | Search this Thread |
* adobe ansi api array asterisks binarysearch calculate centimeter char character cm convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile createprocess() csyntax directory feet fflush fgets file floatingpointvalidation fork frequency function givemetehcodez global graphics gtkgcurlcompiling gtkwinlinux hacking highest homework i/o inches infiniteloop interest intmain() iso keyboard kilometer km linked linkedlist linux linuxsegmentationfault list locate lowest match meter microsoft mqqueue mysql number oddnumber odf open opendocumentformat openwebfoundation owf pattern pdf performance posix power probleminc program programming pyramidusingturboccodes read recv recvblocked repetition reversing scanf scheduling segmentationfault send single socketprograming socketprogramming stack standard string suggestions systemcall unix urboc user variable voidmain() wab whythiscodecausesegmentationfault win32api windows.h






