Puzzles, Maths and Algorithms: Problems solvable using Hashtable
Problem 1: Remove duplicate elements from an unsorted array of size N.
Problem 2: Find intersection of K unsorted array of N elements each. Intersection consists of elements that appear in all the K arrays.
Problem 3: How to make a linked list support operations in O(1) time. The operations on linked list can be insertion after any arbitrary valued node, deletion of any arbitrary valued node.
Problem 4: Find all unique pairs of element in an array that sum to S. For ex. If array = {2,4,6,4,6} and S = 8 then answer is {(2,6), (4,4)}
Problem 5: Consider an array containing unique elements. Find a triplet of elements in the array that sum to S (extension of problem 4). Can hash-tables improve the running time of your algorithm.
Problem 6: Consider two strings of size M, N. Perform string matching in size O(M+N).
Read full article from Puzzles, Maths and Algorithms: Problems solvable using Hashtable
Problem 1: Remove duplicate elements from an unsorted array of size N.
Problem 2: Find intersection of K unsorted array of N elements each. Intersection consists of elements that appear in all the K arrays.
Problem 3: How to make a linked list support operations in O(1) time. The operations on linked list can be insertion after any arbitrary valued node, deletion of any arbitrary valued node.
Problem 4: Find all unique pairs of element in an array that sum to S. For ex. If array = {2,4,6,4,6} and S = 8 then answer is {(2,6), (4,4)}
Problem 5: Consider an array containing unique elements. Find a triplet of elements in the array that sum to S (extension of problem 4). Can hash-tables improve the running time of your algorithm.
Problem 6: Consider two strings of size M, N. Perform string matching in size O(M+N).
Read full article from Puzzles, Maths and Algorithms: Problems solvable using Hashtable