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

bookChallenge: Implement a Custom Hash Table

Tarea

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.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me a real-world example?

close

bookChallenge: Implement a Custom Hash Table

Desliza para mostrar el menú

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 4
single

single

some-alt