Problem Problem: Given 2 strings, consider all the substrings within them of length len. Len will be 1 or more. […]
Tag: set
Test for an array being subset of another master array
Problem I was trying to build a small utility function to check if an array is part of other array. […]
A value set data structure for rapid statistics queries in Java – follow-up
Problem (See the previous iteration.) Now all operations of the data structure work in exact constant time, yet it came […]
Find the rarest in a map
Problem Write a method rarest that accepts a map whose keys are strings and whose values are integers as a […]
Java class: for getOrder, getData, updateData operation
Problem Problem Statement : Design a class for three operations for given set of integers : int getOrder(int data) /* […]
Number of distinct elements in an array
Problem This is my solution to find the Number of distinct elements in an array. Is there away fast way […]
Java Generics and ArrayLists
Problem This abomination of code creates arrays based off input from the user. Sample input would be something like “S […]
Printing the power set of a given set of elements
Problem Input: Set of elements (String) Output: Printing the elements of the power set of the given set public class […]
List union implementation
Problem I’m trying to implement union from the standard Data.List library. I know it’s reinventing the wheel, but reimplementing functions […]
Faster Way of Comparing Generic Sets
Problem The following extension method is the limiting factor in the performance of an application I am developing, according to […]