Useful Points I use chaining for key collisions. The key is also stored with the payload. A GET operation searches the key in bucket’s linked-list and returns the value. #include<bits/stdc++.h> using namespace std; class HashNode { private: string key; string value; HashNode *next; public: HashNode(string key, string value) { this->key = key; this->value = value;…

# Tag: data structures

## C++: Max Product in a Matrix witout Backtrack

Problem Given a matrix, find the path from top left to bottom right with the greatest product by moving only down and right. The code is in C++. The only moves allowed are down and right. The solution works for positive numbers. Reference https://www.byte-by-byte.com/matrixproduct/?utm_source=optin_carrot&utm_medium=pdf&utm_campaign=50questions Written with StackEdit.

## C++: Find Longest Sequence of Numbers in An Unsorted Array

Given an unsorted array, find the length of the longest sequence of consecutive numbers in the array. $ g++ -std=c++11 ./FindLongestSequence.cc $ ./a.out 4 Reference https://www.byte-by-byte.com/consecutivearray Written with StackEdit.