我正在尝试在 scala 中实现惯用的就地快速排序。为此,我正在递归视图而不是(左,右)索引对。但是,我遇到了从视图中获取视图的问题。
Array(1, 2).view => IndexedSeqView[Int, Array[Int]]
Array(1, 2).view.view => IndexedSeqView[Int, IndexedSeqView[Int, Array[Int]]]
等等。这使我无法递归地划分某些基本数组的视图的视图,因为我的递归函数不知道期望什么类型。有没有办法让 IndexedSeqView[Int, Array[Int]] 的视图也是 IndexedSeqView[Int, Array[Int]] 的视图?