Tag: hash_table
Valid Sudoku
Date: 3/8/2024Tags:algorithmsleetcodehash_tableThe journal entry discusses a solution to the "Valid Sudoku" problem by creating hash tables for rows, columns, and squares in a Sudoku board and checking for any number repetition to determine if the board is valid.
Task Scheduler
Date: 2/28/2024Tags:algorithmsleetcodeheap_sorthash_tableThe journal entry discusses the Task Scheduler problem, which involves scheduling tasks with cooling intervals efficiently by prioritizing tasks based on frequency using a max heap, with provided code implementing the scheduling algorithm.
3sum
Date: 2/27/2024Tags:algorithmsleetcodehash_tableThe journal entry discusses the "3sum" problem, highlighting two approaches (hash table and two pointers) with a preference for the hash table approach, detailing the algorithm's logic involving three pointers (`i`, `j`, and `k`) to find unique triplets in a sorted array `nums`, ensuring efficient computation and storing results without redundancy.
Group Anagrams
Date: 2/27/2024Tags:algorithmsleetcodehash_tableGiven an array of strings, the goal is to group the strings by anagrams, achieved by using a hash table with sorted strings as keys to store corresponding anagrams, following sorting and grouping logic in O(NKlogK) time complexity and O(NK) space complexity.
Implement Trie (Prefix Tree)
Date: 2/24/2024Tags:algorithmsleetcodehash_tableThe journal entry presents an implementation of a Trie data structure for efficient string retrieval, utilizing a TrieNode class with value and nexts map and a Trie class with methods for insertion, searching, and checking prefixes, implementing an "end" marker for word differentiation, accompanied by the provided programming code.