Giter Site home page Giter Site logo

linkedlist-c's Introduction

Linked List in C

System

Language

Simple Linked List in C. Full implementation of linked list, with no read/write errors or memory leaks, checked with Valgrind.

Using calloc to initialize struct, so if user enters a invalid value, it is already set to zero. Using hardcoded lenghts for char arrays and malloc calls, to make tests simpler. Will be changed to dynamic values later;

Implemented Methods

    1 - Insert Data         // Insert new node
    2 - Print Data          // Print Entire list
    3 - Delete Data         // Delete Entire list
    4 - Remove Last         // Remove Last node
    5 - Remove selected     // Entering a string
    6 - Exit

Notes

  • Fixed SIGSEV error, when trying to remove a node wich doesnt exist;
  • The current List is a queue, where the first is always first, and new members are put in the end of the list.(Last In First Out)
  • "first" pointer and "last" pointer keeps track of the data in their respective positions.

To-do

  • Implement Deletion
  • Implement Delete Selected Methods
  • Create typedef for struct
  • Implement Insertion in place
  • Implement Stack (FIFO)
  • Implement union
  • Save and list to file (sqlite3 or bin)
  • Implement Generic methods
  • Remove Global variables

Valgrind Analysis

After testing all the operations

==9103== HEAP SUMMARY:
==9103==     in use at exit: 0 bytes in 0 blocks
==9103==   total heap usage: 8 allocs, 8 frees, 2,183 bytes allocated
==9103== 
==9103== All heap blocks were freed -- no leaks are possible
==9103== 
==9103== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

linkedlist-c's People

Contributors

mateusns12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.