Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Small code errors for the LinkedList and HashTable data structures

Aperta
#1,033 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@tmichell13 ci sta già lavorando.

Dal 8/5/2023.

  • #1037 di @tmichell13 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
data

Direzione di ricerca

Search the LinkedList delete() method and the HashTable constructor in the JavaScript source. Check the surrounding implementations and existing tests before making the two corrections described in the issue; done means both data structures use the intended statements without changing other behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello!

As I went through the code for these data structures, I noticed two small errors:

  1. inside the delete() method of the LinkedList data structure, there is a line of code that says: while (this.head && this.compare.equal(this.head.value, value)). However, instead of a while it should be an if statement.

  2. inside the constructor() of the HashTable data structure, we initialize an array in the following way: this.buckets = Array(hashTableSize).fill(null).map(() => new LinkedList());. However, the Array() constructor should have the new keyword in front of it.

If you guys feel that these are important fixes to you and if you allow me to help, I would be more than glad to contribute by creating a pull request with the changes made.

Lingua principale
JavaScript
Stelle
197k
Fork
31k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di trekhleb/javascript-algorithms

Tutte le issue di trekhleb/javascript-algorithms

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.