It is difficult: bubbleSort 2D array

2007-03-26 7:56 pm
int [][] M ={{1,1000}, {2, 2400}, {3, 600}, {4, 100}};
bubbleSort(M);

(do we need create a new array N?)

after sort :
int [][] N ={ {4, 100},{3, 600},{1,1000}, {2, 2400} };


Thank you very much

回答 (1)

2007-03-27 6:48 pm
✔ 最佳答案
it depends on your program.

if your bubbleSort method returns a 2D array, then u just need to do

M = bubbleSort(M);

if your M is an instance array and your bubbleSort does not return anything, then u just need

bubbleSort (M);


收錄日期: 2021-04-13 15:36:16
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070326000051KK01021

檢視 Wayback Machine 備份