[Purdue-pm] PM meeting this Tuesday, June 15th

Mark Senn mark at ecn.purdue.edu
Thu Jun 10 09:47:53 PDT 2010


  Rick>    We do have several challenge problems out on the table.  The
  Rick> most recent is from Joe and is summarized below.  I had
  Rick> suggested that the fastest way to access the data was via an
  Rick> array.  And indeed Mark sent out an elegant [Perl 5 -mark]
  Rick> solution that used an array.

I'll try to send a Perl 6 solution to the list before the next meeting.

  Rick>                               I am not sure if we can do
  Rick> better than that.  That is the solution is O(1) ignoring, as is
  Rick> typical, setup time.  And space is O(x) where 'x' is the size of
  Rick> the array.  However what if we have a very large and sparse
  Rick> array?  And if we do wish to consider setup time plus minimizing
  Rick> memory space?  Then what type of solution can be found?

Doing a Google search for
    perl sparse arrays
gave around 20,900 results.  I thought (next line over 80 chararacters)
    http://etutorials.org/Programming/Perl+tutorial/Chapter+4.+Arrays/Recipe+4.4+Implementing+a+Sparse+Array/
and
    http://stackoverflow.com/questions/863426/counting-array-elements-in-perl
were helpful.  (Mathematica---my second favorite programming language,
has sparse arrays built-in.)

  Rick>         And if we do wish to consider setup time plus minimizing
  Rick> memory space?  Then what type of solution can be found?

I don't want to consider it---too hypothetical in the context of the
simple challenge problem.  Use hashes for the 1D case.  Maybe spin this
off into a 2D or more challenge problem to better investigate setup time and
minimizing memory space?    -mark


More information about the Purdue-pm mailing list