Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Implement a Custom Hash Table | Core Algorithms for Data Processing
Data Structures and Algorithms for Scalable Systems

bookChallenge: Implement a Custom Hash Table

Compito

Swipe to start coding

In this challenge, you will implement a hash table using chaining to resolve collisions. Your implementation must support three operations:

Required Behavior

  • put(key, value):
    • Insert a key-value pair into the table.
    • If the key already exists, update its value.
  • get(key):
    • Return the value for the given key.
    • If the key does not exist, return None.
  • delete(key):
    • Remove the key-value pair from the table.
    • If the key does not exist, do nothing.

Chaining Requirements

  • The table consists of an array of buckets.
  • Each bucket stores a list of (key, value) pairs.
  • Collisions are handled by appending to the appropriate list.

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 4
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

close

bookChallenge: Implement a Custom Hash Table

Scorri per mostrare il menu

Compito

Swipe to start coding

In this challenge, you will implement a hash table using chaining to resolve collisions. Your implementation must support three operations:

Required Behavior

  • put(key, value):
    • Insert a key-value pair into the table.
    • If the key already exists, update its value.
  • get(key):
    • Return the value for the given key.
    • If the key does not exist, return None.
  • delete(key):
    • Remove the key-value pair from the table.
    • If the key does not exist, do nothing.

Chaining Requirements

  • The table consists of an array of buckets.
  • Each bucket stores a list of (key, value) pairs.
  • Collisions are handled by appending to the appropriate list.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 4
single

single

some-alt