<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hiruni Malaviarachchi on Medium]]></title>
        <description><![CDATA[Stories by Hiruni Malaviarachchi on Medium]]></description>
        <link>https://medium.com/@mail2hiruni?source=rss-9757cd3fd95f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*ze51fOMyD-1fKOdcQqOSJg.jpeg</url>
            <title>Stories by Hiruni Malaviarachchi on Medium</title>
            <link>https://medium.com/@mail2hiruni?source=rss-9757cd3fd95f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:25:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mail2hiruni/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Two minutes on NPM]]></title>
            <link>https://medium.com/path-to-full-stack-development/two-minutes-on-npm-dd43d438c43b?source=rss-9757cd3fd95f------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd43d438c43b</guid>
            <dc:creator><![CDATA[Hiruni Malaviarachchi]]></dc:creator>
            <pubDate>Thu, 16 Apr 2020 09:59:47 GMT</pubDate>
            <atom:updated>2020-04-16T09:59:47.413Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*JtVqyOAM3YSvvffy_Rn9vw.png" /></figure><h4>What is NPM?</h4><p>NPM, which stands for Node Package Manager is the world’s largest software library and it works as an installer too. It is identified as the default package manager for the javascript run time environment Node.js.</p><p>NPM consists of three distinct components:</p><ul><li>the website</li><li>the Command Line Interface (CLI)</li><li>the registry</li></ul><h3>Use npm to-</h3><ul><li>Adapt packages of code for your apps, or incorporate packages as they are.</li><li>Download standalone tools you can use right away.</li><li>Run packages without downloading using <a href="https://www.npmjs.com/package/npx">npx</a>.</li><li>Share code with any npm user, anywhere.</li><li>Restrict code to specific developers.</li><li>Create Orgs (organizations) to coordinate package maintenance, coding, and developers.</li><li>Form virtual teams by using Orgs.</li><li>Manage multiple versions of code and code dependencies.</li><li>Update applications easily when underlying code is updated.</li><li>Discover multiple ways to solve the same puzzle.</li><li>Find other developers who are working on similar problems and projects.</li></ul><p>Global installations will be available throughout the system while local installations will only be available for that particular application. By default, all the dependencies will get installed to ‘node_modules’ directory. ‘package.json’ contains all information related to the NodeJS application. The file be placed in the root directory of the application. ‘package.json’ will contain name, version, author, repository, required node version, scripts and dependencies etc.</p><h4>Install NPM</h4><p>npm is distributed with <a href="https://nodejs.org/">Node.js</a>- which means that when you download Node.js, you automatically get npm installed on your computer.</p><p>Here I have included the link to download node.js LTS that is recommended for most users.</p><p><a href="https://nodejs.org/en/">Node.js - Run JavaScript Everywhere</a></p><p>To check if you have Node.js installed, run this command in your terminal:</p><pre>node -v</pre><p>To confirm that you have npm installed you can run this command in your terminal:</p><pre>npm -v</pre><h3>A note on versions</h3><h3>npm versions</h3><p>npm is a separate project from Node.js, and tends to update more frequently. As a result, even if you’ve just downloaded Node.js (and therefore npm), you’ll probably need to update your npm. Luckily, npm knows how to update itself! To update your npm, type this into your terminal:</p><pre>npm install npm@latest -g</pre><blockquote>A simple note to keep on mind — try <strong><em>npx</em></strong> instead of <strong>npm </strong>if you do not want to install packages.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd43d438c43b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/path-to-full-stack-development/two-minutes-on-npm-dd43d438c43b">Two minutes on NPM</a> was originally published in <a href="https://medium.com/path-to-full-stack-development">Path to full stack development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SQL or NoSQL?]]></title>
            <link>https://medium.com/beginning-of-becoming-a-tech-enthusiast/sql-or-nosql-4ad41c73570a?source=rss-9757cd3fd95f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ad41c73570a</guid>
            <dc:creator><![CDATA[Hiruni Malaviarachchi]]></dc:creator>
            <pubDate>Sun, 29 Mar 2020 05:30:11 GMT</pubDate>
            <atom:updated>2020-03-29T05:30:11.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-fYuURITlpsGyKpfqKP6gg.png" /></figure><h4>What is SQL?</h4><p>SQL, which stands for Structured Query Language is a method that is used to communicate with a database. Queries in SQL are used to perform tasks such as update data on a database, retrieve data or delete them.</p><p>RDBMS is considered to be the basis for SQL, and for all modern database systems such as MS SQL Server, Oracle, MySQL, and Microsoft Access. Here, every table is broken into smaller entities called fields. The database is most often contains one or more tables. Each table has many rows and each row can be identified using a unique key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FmF_kBC_gK0mxMYP-S4p-Q.png" /></figure><blockquote><strong>Pros</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*4AO-5sUzv9bDOL_-gdB5OA.png" /></figure><blockquote><strong>Cons</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*PNMZigdBYkIsSFqOXyvLsg.png" /></figure><h4>What is NoSQL?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*aft5e_gFeDW4DQ8tayEsrA.png" /></figure><p>NoSQL is a non relational, schema free, distributed database. This is horizontally scalable and serves easy replication so you can copy all or part of database and distribute it to one more servers.</p><p>NoSql renders <strong>eventual consistency. </strong>Eventual consistency means exactly that: the system is eventually consistent–if there are no updatesthat have been made to a given data item for a long enough period of time, sometime after hardware and network failures heal, then, eventually, all reads to that item will return the same <strong>consistent</strong> value.</p><p>NoSQL generally stands for “Not Only SQL” or “Non SQL” but it has not been provided a clear name.</p><blockquote><strong>Pros</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*AirOBXvsh0A4i9L9q0Ow7g.png" /></figure><blockquote><strong>Cons</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*mPysOpmLdjyMe638NDVdlA.png" /></figure><h4>When to use NoSQL?</h4><ul><li>To handle a huge volume of structured, semi-structured and unstructured data.</li><li>Where there is a need to follow modern software development practices like Agile Scrum and if it is needed to deliver prototypes or fast applications.</li><li>If it is preferred object-oriented programming.</li><li>If the relational database is not capable enough to scale up to your traffic at an acceptable costs</li><li>If it is needed to have an efficient, scale-out architecture in place of an expensive and monolithic architecture.</li><li>If there are local data transactions that need not be very durable.</li><li>If it is needed schema-less data and needs to be include new fields without any ceremony.</li><li>When the priority is easy scalability and availability.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*LlQAD16dOtFd9T5_MvyoQQ.png" /></figure><h4>Conclusion</h4><p>Choosing a database needed for our work is upto our preferences and need. Although it has been used SQL in most of the primary instances, NoSql is now gaining more popularity and we can see the reasons from above mentioned topics.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ad41c73570a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast/sql-or-nosql-4ad41c73570a">SQL or NoSQL?</a> was originally published in <a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast">Beginning of becoming a tech enthusiast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Node JS?]]></title>
            <link>https://medium.com/beginning-of-becoming-a-tech-enthusiast/why-node-js-b0bf7fdd6bd4?source=rss-9757cd3fd95f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0bf7fdd6bd4</guid>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Hiruni Malaviarachchi]]></dc:creator>
            <pubDate>Tue, 10 Mar 2020 20:24:39 GMT</pubDate>
            <atom:updated>2020-03-10T20:24:39.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*tXWaWxRqLAdJ_cBMn_qyLQ.png" /></figure><p>Because of the rising popularity of Java script, it has brought a very improved newer face to the web development nowadays with lot of changes.</p><p>Node js is a free, open source, server-side cross-platform runtime environment created with the aim of creating real time websites with push capabilities. It is used to run scripts on the server to render content before it’s been delivered to the web browser.</p><h4>Node .js event loop</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*Jiut4Xav4E1tfby6nnP57Q.png" /></figure><p>Node.js uses asynchronous programming.</p><p>Node.js handles a file request by sending the request to the file system first. It makes it ready to handle the next request then. When the file system has opened and read the content, it is now ready to deliver the content to the client.</p><p>This simply means that node.js does not wait and it simply process the next request.</p><h4>Pros of node.js</h4><blockquote>Since node.js has been built on Google chrome’s v8 javascript engine, it is very fast.</blockquote><blockquote>Node.js is single threaded.</blockquote><blockquote>Easily scalable both horizontally and vertically.</blockquote><blockquote>support for common tools like unit testing.</blockquote><blockquote>Uses its npm (node package manager) which contains large number of reusable modules.</blockquote><blockquote>can generate dynamic web content.</blockquote><h4>Cons of Node.js</h4><blockquote>Asynchronous programming model is complex compared to synchronous model.</blockquote><blockquote>Any CPU serious calculation will block node.js responsiveness, so a threaded platform is a better approach.</blockquote><blockquote>The actual number of robust libraries in node.js are comparatively low.</blockquote><h4>Concepts of Node.js</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*lyWRTJFS50P2cuix3I_Iow.png" /></figure><h4>Usecases of Node.js</h4><ul><li>I/O bound Applications</li><li>Data Streaming Applications</li><li>Data Intensive Real-time Applications (DIRT)</li><li>JSON APIs based Applications</li><li>Single Page Applications</li></ul><p>Node.js should not be used in high intensive CPU applications!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0bf7fdd6bd4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast/why-node-js-b0bf7fdd6bd4">Why Node JS?</a> was originally published in <a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast">Beginning of becoming a tech enthusiast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to React JS]]></title>
            <link>https://medium.com/beginning-of-becoming-a-tech-enthusiast/introduction-to-react-js-c2858e39a308?source=rss-9757cd3fd95f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2858e39a308</guid>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Hiruni Malaviarachchi]]></dc:creator>
            <pubDate>Thu, 05 Mar 2020 10:30:33 GMT</pubDate>
            <atom:updated>2020-03-05T10:30:33.563Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AOP74sefIB3fnItNDHnU6A.jpeg" /></figure><h3>Is React a Framework?</h3><p>The answer is no. React JS is actually a front-end library which has been developed by facebook and instagram which again is now under facebook.</p><p>React is for building user interfaces and managing the rest of the project is up to our preference. It serves as the view of MVC architecture and is suitable for large web applications which use data and change over time without having to reload the entire page. Node JS is the running environment of React.</p><p>React abstracts the Document Object Model(DOM) away from us giving out a simple and better performance. React implements a one-way data flow.</p><h3>Features in React</h3><blockquote>JSX — This is the language used by react in defining its user interfaces. Use HTML like syntax (java script syntax extension). Prevent cross-site scripting attacks.</blockquote><blockquote>Components — Everything in react work as components.</blockquote><blockquote>Data flow is from parent component to child component while the action flow is vice versa.</blockquote><blockquote>Uses a virtual DOM which is a Java Script object that helps to maintain the performance of the application.</blockquote><h4>Render</h4><p>The way that react uses to return a description of what we should see on the screen is the render method. This renders the components.</p><p>Each time the props and states are changed, render is called.</p><p>This never uses the setState function although it can define variables and do some operations inside.</p><h4>Props and State</h4><p>The main difference between props and states is that props are unchangeable over time.</p><p>Data and behaviors from container components to child components are passed through props and props are read-only material.</p><p>State is the place that hosts data. If there are multiple components which need data from state, it should maintain a single container which in turn keeps the state for all of them. State is read-write enabled.</p><p>The following will show you how to combine props and state in an application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*ktJ0gcStkKwL-y3Ig2NKNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*30IwCNXNM5KbYEBB8KN3Dg.png" /></figure><p>So this is just a simple introduction on React JS and I think you would find it interesting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2858e39a308" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast/introduction-to-react-js-c2858e39a308">Introduction to React JS</a> was originally published in <a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast">Beginning of becoming a tech enthusiast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dealing with Java Script closure, callback and Promises]]></title>
            <link>https://medium.com/beginning-of-becoming-a-tech-enthusiast/dealing-with-java-script-closure-callback-and-promises-59428f53c416?source=rss-9757cd3fd95f------2</link>
            <guid isPermaLink="false">https://medium.com/p/59428f53c416</guid>
            <dc:creator><![CDATA[Hiruni Malaviarachchi]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 02:20:48 GMT</pubDate>
            <atom:updated>2020-02-20T02:20:48.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WBgFWPDVqDrG8ZtDxttHJQ.jpeg" /></figure><p>Java script is a common programming language which runs using a single thread. This does not wait until it completes the I/O operations, instead it continues the execution process which is called as non-blocking I/O. Java script is dynamic and it exists or occur at the same time which is synchronous. As a multi-paradigm language, Java script supports event-driven, functional and imperative programming styles.</p><p>When creating objects in java script, it uses ‘this’ keyword with the help of a constructor and if a function has been used with a ‘new’ keyword, that acts as a class. The code declared with a function and class both return a [prototype].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*yr7gHOFJDPdhYJwKyhJ5Ew.png" /></figure><h3><strong>Closure</strong></h3><p>Closure is one of significant idea in JavaScript. It is broadly talked about and still confounded idea. We should comprehend what the closure is. Closure implies that an internal function consistently approaches the variables and parameters of its external function, much after the external function has returned.</p><p>We have discovered that we can make settled functions in JavaScript. Inner function can get to variables and parameters of an outer function(be that as it may, can’t get to access object of outer function).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*QckLnb3sNZrAP9B2DcpW2w.png" /></figure><p>Here, the InnerFunction() has the access to the outer variable even if it will be executed seperately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*qS30A0RZ7YgxjA0owf1iag.png" /></figure><p>Here, the return innerFunc returns InnerFunction from OuterFunction when it has been called the OuterFunction(). In here, the variable innerFunc has the reference to InnerFunction() only, not the OuterFunction(). If we call the innerFunc(), it can still access outerVariable that has been declared in the OuterFunction(). This is called closure.</p><blockquote><strong>When to use closure?</strong></blockquote><p>In Java Script, a closure is used to hide the implementation and encapsulate variables into a function and restrict access to it from the outside. In other words, it tends to be valuable to make private variables or functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*tEpdSSSnq81m2Q2_wy7OIA.png" /></figure><h3>CallBack</h3><p>All I/O functions in Java Script is implemented to be asynchronous in nature. Since Java Script is a single threaded programming language, if an I/O function keeps holding the thread for a longer period till it finishes its execution process, Java Script will not perform better as a programming language. This why we need promises and callbacks.</p><p>Simply, callback is the term used in java script when a function starting to execute when another function has finished its execution procedure. Java script will continue executing a particular function while listening to other events as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/1*eMjOOc2WdNnME_9buiCBAw.png" /></figure><p>Here the outputs will be 1, 2.</p><p>A problem arises when the function first() comes with another function that does not needed to be executed immediately. As a solution we can introduce a setTiomeout() function. This will delay the function execution.</p><p>Nested callbacks pass into sequence of async tasks is referred to as ‘callback hell’.</p><h3>Promises</h3><p>These handle the asynchronous operations in Java Script. When callbacks have created call back hell, where the code has led to an unmanageable state, these promises are used. Promises can handle multiple asynchronous operations easily providing better error handling than callbacks.</p><blockquote>Benefits of Promises</blockquote><blockquote>Improved code readability</blockquote><blockquote>Handling asynchronous operations in a better way</blockquote><blockquote>Easy error handling</blockquote><p>A promise works like a basic if-else statement. This statement can be simply understood better with the following statements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*zNfB83r4Tkaqo4yg6ap_DQ.png" /></figure><p>A promise is composed with four stages.</p><blockquote>Pending- A promise is neither fulfilled nor rejected</blockquote><blockquote>Fulfilled- A promise has gained its success</blockquote><blockquote>Rejected- A promise has failed in doing its task</blockquote><blockquote>Settled- A promise has fulfilled or succeeded</blockquote><p>A promise can be created by using the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*fXCzW-tKUqoCFTJWCAx56Q.png" /></figure><p>A promise parameter takes only one parameter, that is a callback function in Java script. But compared to promises, callback functions take two parameters; resolve and reject.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*WGcjfPHHeSDRxsPecfG6Ag.png" /></figure><p>If the desired function does not go well, reject is called.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*4nlYk19c2wDIo0OvgphhvA.png" /></figure><p>Promises can be consumed with the use of <strong><em>.then</em></strong> and <strong><em>.catch</em></strong> methods.</p><p>.then is invoked when a promise is either invoked or rejected.</p><p>.catch is used when either the code is rejected or it has some errors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*qx8q6tkUx2D8HzVs6slPiA.png" /></figure><p>Thus, this is just an overview of some of the concepts dealt in Java Script with regard to API functions and event handling.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59428f53c416" width="1" height="1" alt=""><hr><p><a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast/dealing-with-java-script-closure-callback-and-promises-59428f53c416">Dealing with Java Script closure, callback and Promises</a> was originally published in <a href="https://medium.com/beginning-of-becoming-a-tech-enthusiast">Beginning of becoming a tech enthusiast</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Single Linked Lists using C]]></title>
            <link>https://medium.com/@mail2hiruni/introduction-to-single-linked-lists-using-c-291abc34a72e?source=rss-9757cd3fd95f------2</link>
            <guid isPermaLink="false">https://medium.com/p/291abc34a72e</guid>
            <dc:creator><![CDATA[Hiruni Malaviarachchi]]></dc:creator>
            <pubDate>Sat, 15 Feb 2020 18:18:08 GMT</pubDate>
            <atom:updated>2020-02-15T18:18:08.383Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*6ReSYwX-z-n4jWPCRSxqBw.png" /></figure><h4>Why use Linked lists and not arrays?</h4><p>When compared to Linked lists, arrays are a linear collection of data elements in which the elements are stored in consecutive memory locations.</p><p>Before getting use of arrays, we have to declare them with a specific data type and a size which will then restrict the number of elements that it can store. But in a linked list, data is allocated at run time by adding new nodes consecutively. This is known as dynamic memory allocation. Compared to linked lists, arrays can not allocate memory at run time. Therefore it allocates memory at compile time. Thus undoubtedly Linked list data structure is more appropriate than Arrays in most of the cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*UnuASeFrZu2c4D2vCQyGHw.png" /></figure><blockquote>The c code to implement a linked list:</blockquote><p><em>struct node{</em></p><p><em>int data;</em></p><p><em>struct node * next;</em></p><p><em>};</em></p><h4>How a linked list is maintained in the memory</h4><p>A particular node in linked list has two fields named DATA and NEXT. The DATA part will hold the information that is needed to be stored and the NEXT part will hold the address of the next node to be implemented.</p><p>The variable START will hold the address of the first node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*7u5F1yYiC-2RvU047ayxlw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*xUZedYw7lIOo7fFvogZB9w.png" /></figure><h4>Memory Management in C</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*d4LB3rFZ8z4y_dbEaxPbvA.png" /></figure><blockquote>C malloc()</blockquote><p><em>Ptr = (int*) malloc (100 * sizeof(int))</em></p><p>This will allocate either 200 or 400 bytes according to size int 2 or int 4 respectively while the pointer points to the first byte.</p><blockquote>C calloc()</blockquote><p><em>Ptr = (cast-type*) calloc (n,element-size)</em></p><p>This will allocate contiguous space for memory in n elements of an array.</p><blockquote>Free()</blockquote><p>Dynamically allocated memory using above two functions does not get freed by their own. For this reason, we must need the function free().</p><h4>Single Linked Lists</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*BTq27dVSzCKm32a7OSLzvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*ghOwUzDCLh61rPrUnCxn3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*GW3IW19ch1QDCEE5wNPURw.png" /></figure><h4>Basic operations in a single linked list :</h4><blockquote>Creation</blockquote><blockquote>Insertion</blockquote><blockquote>Deletion</blockquote><blockquote>Traversing</blockquote><h4>Creation</h4><p>Creation includes creating a new node and allocating necessary memory size for it. This is stored in the memory allocated with the use of the function malloc().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*XGcn8ZzPLldnbGV_jb7K2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*tXDKcsZWwZWSURWq_Z3psA.png" /></figure><h4>Traversing</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*b-jxCm11bMsi2OfSaJMplw.png" /></figure><h4>Inserting a new node at the beginning of a linked list</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*Jxl9GvKAgS0SH3LA4MCJeA.png" /></figure><h4>Deleting the first node of a linked list</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*yiu1qu1P5HSSUHzKLLGugg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*DZn_jhsaFrbuduLH3MEHow.png" /></figure><h4>C program to create linked list and perform insertions and deletions for all cases</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*1jAK_nAVa9ecmNAO-lQ1EQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*yzTJqhUHC2tLQndlJLcsnw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/1*HFcX0CZFatFRjMkk6EECKQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*LsdvXWABDwv7s1uhGcraFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*JgSzbIl5PWI6I2G8dkhNRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*nVzvrzhk9BDSRmb1ww1eCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*QFqYg7es6Ap7yCE40oAW8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*YnHq6-_Ti0B2e2PBH2MhmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*3XGBxpXCuwRlMWrZT-0kbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*jw17EIjvj4SgbieZfALcPA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*jRg6URVBJLSk1QRBexKlxA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*Z7f0P5B1FG2OeePPfVS5Iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*zHK4ViCMdCstXRmteV0CEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*v1fNk8Hk1bAfxJ7yYYTUDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*zyp0v8h5MC1ZTu_PbPKB0w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*L6q2F4u_SUTG8rUnW4Mz6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*lZBIwPgmP8BPJJD2vrgV1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*8BicMEpKnYMl7lZlazkgLA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=291abc34a72e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>