在二维数组中查找循环 [英] Finding cycle in 2 dimensional array
本文介绍了在二维数组中查找循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我想在2维(nxm)数组中找到循环。我在我的阵列中有nm-1填充单元格,我想找到循环开始空单元格,继续在填充单元格中完成空单元格。
例如我们有这个数组;
图片
我们的第一个周期是[0,0],[0,3],[2,3],[2,0]
第二个周期是[0,1],[0 ,3],[2,3],[2,2],[3,2],[3,1]
如何找到所有周期在这个数组中。
感谢您的帮助。
Hi i want to find cycles in 2 dimensional(nxm) array. i have n.m-1 filled cell in my array and i want to find cycle starting empty cell, continues in filled cells an finish in empty cell.
For example we have this array;
image
our first cycle is [0,0],[0,3],[2,3],[2,0]
second cycle is [0,1],[0,3],[2,3],[2,2],[3,2],[3,1]
How can i find find all cycles in this array.
Thanks for any help.
推荐答案
您已经在 http://www.codeproject.com/Messages/4562355/寻找循环二维阵列-Stepping-Ston.aspx [ ^ ]。请仅在一个论坛发帖。
You already posted this question at http://www.codeproject.com/Messages/4562355/Finding-cycle-in-2-dimensional-array-Stepping-Ston.aspx[^]. Please post in one forum only.
这篇关于在二维数组中查找循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文