Linked List 2 : Single Linked List


Hello Guys, back with me again. After the opening of last week, I would like to tell you guys about the commonly used "module?" used in Linked List. Alright, lets get to it XD

--First of all there is to main method we will use in the code which is
Malloc -> sort of like reserve a certain memory space to be used
Free -> release the memory space that you reserved
Sizeof -> see the size of an object/variable

--In linked list, we normally use module such as Print, Pop-deletion & Push-insertion. Look at following code. Note that we always initiate current with Malloc at the beginning of the module. That serves as a container for the new value to be inserted to the record.
 To be noted here in Pop function also, we should always free up the memory space if we no longer uses the memory to prevent the record from bulking in size.
That's it for today, stay tuned for more!

Comments

Popular posts from this blog