Data Structures & Algorithms on NucuLabs
https://blog.nuculabs.dev/categories/data-structures-algorithms/
Recent content in Data Structures & Algorithms on NucuLabsNucuLabshttps://blog.nuculabs.dev/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E
https://blog.nuculabs.dev/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E
Hugo -- gohugo.ioen-usSun, 15 Sep 2024 00:00:00 +0000The Hash Set
https://blog.nuculabs.dev/posts/2024/2024-09-15-dsa-hash-set-golang/
Sun, 15 Sep 2024 00:00:00 +0000https://blog.nuculabs.dev/posts/2024/2024-09-15-dsa-hash-set-golang/Introduction A hash set is a data structure that allows storing elements inside a set using a hash function.
The set is a data structure that offers efficient access to its elements and does not allow duplicates. The uniqueness of an element in the hash set is determined by the hash function, in this implementation hash collisions are not handled. If the hash of “a” is 123 and the hash of “b” is 123 as well then we consider “a” and “b” to have a hash collision and if “a” is already present in the set adding “b” has no effect.Ranking: BM25+
https://blog.nuculabs.dev/posts/2024/2024-06-03-dsa-ranking-bm25/
Mon, 03 Jun 2024 00:00:00 +0000https://blog.nuculabs.dev/posts/2024/2024-06-03-dsa-ranking-bm25/Introduction The BM25+ is a ranking algorithm used to rank text documents based on a relevance score.
It is used in search engines to determine which documents are the most relevant given a terms query.
The algorithm implemented is based on the Improvements to BM25 and Language Models Examined paper.
Implementation An index can be used to index the terms and the documents in which the terms occur:
[term: apples] - doc1, doc2, doc3 [term: grapes] - doc2, doc4 When a user queries using the apples term then doc1, doc2 and doc3 is returned.The Linked List
https://blog.nuculabs.dev/posts/2024/2024-04-17-dsa-linked-list/
Wed, 17 Apr 2024 00:00:00 +0000https://blog.nuculabs.dev/posts/2024/2024-04-17-dsa-linked-list/Introduction A linked list is a fundamental data structure which consists of Nodes that are connected to each other.
Other variations are:
Double linked list Circular linked list (circular buffer) The Singly Linked List To visualize the data structure, if you want to store two integers 10 and 20 you will have a 2 node linked list that will have: [Node 1, Value 10] -> [Node 2, Value: 20] -> [null]