Commit Graph

9 Commits

Author SHA1 Message Date
Aryadev Chavali
f4b08ddada (list)+map function
void return, just maps f onto every value in the linked list till
nullity.
2021-11-22 05:53:07 +00:00
Aryadev Chavali
1537bb705b (list)~NULL -> nullptr
C++ styling.
2021-11-22 05:52:49 +00:00
Aryadev Chavali
36d5eb111a (list)+recursive reverse algorithm for singly linked lists
Pretty simple, returns the last node as that's the new root node.
Uses default parameters to make sure the first node has next set to null.
2021-11-21 00:28:23 +00:00
Aryadev Chavali
2f0fe5aef2 (list)+general style change, use unary switches for checking null 2021-11-21 00:28:01 +00:00
Aryadev Chavali
e30444cdde (list)+destructor function in struct
Nice feature of C++, destructors make it kinda nice to do memory
management. Though they don't fully reduce the pain lol
2021-11-20 22:57:27 +00:00
Aryadev Chavali
cae91a793c (list)+first test with appends and output
Main now uses append and cout mechanisms for a simple program!
2021-11-20 22:51:25 +00:00
Aryadev Chavali
fc6fc4032b (list)+simple output mechanism via C++ streams
cout has inbuilt support for multiple types, easier than using
printf.  Just have to ease the compiler into it
2021-11-20 22:50:05 +00:00
Aryadev Chavali
fccfcd4a9f (list)~struct List is not necessary
Slight whiplash from change to C++, can just use typename now.
2021-11-20 22:40:56 +00:00
Aryadev Chavali
a495bd9c64 (list)+list.cpp file
Will have all the singly linked list algorithms I can think of, using
the structure I have defined (template based singly linked list) and
the simple append function I have added that also acts as the main
method of creating an instance.
2021-11-20 22:35:32 +00:00