Skip to content
View ruhilmansi's full-sized avatar
:octocat:
1.618, 3.14
:octocat:
1.618, 3.14
  • 127.0.0.1

Block or report ruhilmansi

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
ruhilmansi/readme.md

hi, i'm mansi

mail- mail me
portfolio- uwuntu
linkedin- linkedin


my cute lil hashmap <3

class HashMap:
    def __init__(self):
        self.bucket = []
        for i in range(7):
            self.bucket.append([])

        print("hashmap initialized (exploring data structures beyond built-ins)")
        # i genuinely love hashmaps <3

    def put(self, key, value):
        index = hash(key) % len(self.bucket)

        for i, (k, v) in enumerate(self.bucket[index]):
            if k == key:
                self.bucket[index][i][1] = value
                print(f"updated '{key}' with new value")
                return

        self.bucket[index].append([key, value])
        print(f"added '{key}' → '{value}'")

    def get(self, key):
        index = hash(key) % len(self.bucket)

        for k, v in self.bucket[index]:
            if k == key:
                print(f"found '{key}'")
                return v

        print(f"'{key}' not found (maybe added it later)")
        return None

    def remove(self, key):
        index = hash(key) % len(self.bucket)

        before = len(self.bucket[index])
        self.bucket[index] = [pair for pair in self.bucket[index] if pair[0] != key]
        after = len(self.bucket[index])

        if before != after:
            print(f"removed '{key}'")
        else:
            print(f"'{key}' wasn’t there anyway")

github stats

Pinned Loading

  1. fail-u-forward fail-u-forward Public

    community driven platform where failure is not something to hide but something to celebrate : all the stuff LinkedIn filters out

    TypeScript 2

  2. cli-blockchain cli-blockchain Public

    add transactions, mint blocks and modify difficulty and rewards

    Rust

  3. grammingo grammingo Public

    grammar error correction and misspelling correction

    JavaScript

  4. mariorun-js mariorun-js Public

    mario run

    JavaScript

  5. chess chess Public

    chess game

    Rust

  6. toodo toodo Public

    workspace built to simplify teamwork and improve team coordination (everything in one place)

    JavaScript 1