title: Computing dot product of sparse vectors in less than O(n+m) complexity, where m and n are the number of non zero entries in the respective vectors
body: <p>Given an operation memset(array of values, array of memory location) which stores the corresponding values in the corresponding memory locations and takes O(1) time irrespective of the length of the array. How do you use it to calculate the dot product of sparse vectors in less than O(n+m) complexity? Each vector is represented as a triplet of [val,index,len], where len is the number of non zero entries, index is an array of indexes of non zero entries, and val is an array consisting of the non zero entries, so size of val=size of index=len.
  Assume the array index is sorted.</p>