How to make a big array in java

后端 未结 5 678
抹茶落季
抹茶落季 2020-12-20 17:44

I want to create a boolean array of a size which the user is going to put as input.For example - The user might put a big number like 1000000000000 ; so then I have to creat

5条回答
  •  一个人的身影
    2020-12-20 18:19

    have to create a boolean array of the size 1000000000000. The problem I am facing is , I cant store the input as int

    Your problem isn't that. Your main problem is that you won't have enough memory to allocate a data structure with 1,000,000,000,000 elements (even if you overcame the limitations of int indexing).

    You'll need to rethink the algorithm.

提交回复
热议问题