-2

Despite not encountering any major problems with Java, I cannot say so regarding the OCaml programming language. I am supposed to create a function subMat which for two matrices, checks if matrix A is a submatrix of matrix B, and if so - returns true - val subMat: int list list -> int list list -> bool = <fun>

I would kindly appreciate any help, since I really don't know how to tackle the problem.

PatJ
  • 5,996
  • 1
  • 31
  • 37

1 Answers1

1

This problem can be solved by using int array array or Bigarray.Array2 and then applying a conventional imperative programming approach.

Another approach is to concatenate you matrices into int list and apply a substring finding algorithm, e.g., Knuth-Morris-Pratt (or just invent your own, if you don't want to be too fancy).

ivg
  • 34,431
  • 2
  • 35
  • 63