Jump to content

Singly-linked list/Element removal: Difference between revisions

m
→‎{{header|C}}: Remove vanity tags
m (→‎{{header|C}}: Remove vanity tags)
Line 88:
This implementation takes up integers from the command line and then asks which element has to be removed. List is printed before and after removal, usage printed on incorrect invocation.
<lang C>
/*Abhishek Ghosh, 4th October 2017*/
 
#include<stdlib.h>
#include<stdio.h>
Line 199 ⟶ 197:
1 3
</pre>
 
=={{header|Fortran}}==
This sort of thing has long been done in Fortran via the standard trick of fiddling with arrays, and using array indices as the equivalent of the memory addresses of nodes. The task makes no mention of there being any content associated with the links of the linked-list; this would be supplied via auxiliary arrays or disc file records, ''etc''. With F90 and later, one can define compound data aggregates, so something like LL.NEXT would hold the link to the next element and LL.STUFF would hold the cargo, with LL being an array of such a compound entity rather than separate simple arrays such as LLNEXT and LLSTUFF.
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.