Git Product home page Git Product logo

hashtable's Introduction

Hashtable Project

Ce projet est une implémentation d'une table de hachage en C. Il fournit une structure de données de type clé-valeur, avec des opérations pour insérer, supprimer et rechercher des éléments.

Caractéristiques

  • Implémentation de table de hachage avec chaînage pour gérer les collisions.
  • Utilise l'algorithme de hachage FNV-1a pour générer les indices de hachage.
  • Supporte les types de données personnalisés grâce à la structure value.

Utilisation

Pour utiliser cette table de hachage, vous devez d'abord créer une instance de struct hashtable. Ensuite, vous pouvez utiliser les fonctions fournies pour interagir avec la table de hachage.

struct hashtable table;
hashtable_create(&table);

// Insérer des éléments
hashtable_set_integer(&table, "clé1", 123);
hashtable_set_boolean(&table, "clé2", true);

// Récupérer des éléments
struct value val = hashtable_get(&table, "clé1");
if (value_is_integer(&val)) {
    int64_t num = value_get_integer(&val);
    printf("La valeur est %ld\n", num);
}

// Supprimer des éléments
hashtable_remove(&table, "clé1");

// Détruire la table de hachage
hashtable_destroy(&table);

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.