public static int ListInsertDeletetCount(int []array){
int count = 0;
Random rnd = new Random();
for(int i=0; i<100; i++){
int dst = rnd.nextInt(list.length-1);
for(;;) {
//dst 위치에 dst 숫자 삽입
count++;
}
int dat = rnd.nextInt(list.length-1);
for(;;){
//dst 위치에서 삭제
count++;
}
count = count / 200;
return count;
}
코드는 위와 같은데용 랜덤한 배열 위치에 랜덤한 값을 입력하고 삭제하고를 반복하는 건데 삽입은 list[dst] = dst; 가 아닌가요? 계속해서 에러가 뜨네요 ㅠㅜ 삭제는 뭔지 감이 안와서.. remove 로도 해결이 안되서 여쭤봅니다.