I noticed that initializing a 2D array like this
case 1: -
int ar [] [] = new int [10000001][10] ;
it takes more time than its initialization
case 2: -
int ar[] [] = new int [10] [10000001] ;
in case 1, this time is about 4000 ms, but in case 2 it does not exceed 100 ms; why does this big difference exist?
Strictly speaking, Java does not have 2D arrays: instead, it uses 1D arrays sorted into 1D arrays of arrays.
, , Java 10000001 10 , - 10 10000001 .
, .
Source: https://habr.com/ru/post/1016602/More articles:4-node print tree (plain forest) for benchmarking - javaCheck if all True elements in sliding windows through a 2D array - Python - pythonAllow skype calls from Angular App (using meanjs) - javascriptNode.js: What parts of the code are executed after an asynchronous call? - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1016601/convert-list-of-key-value-object-pairs-to-simple-multimap-using-java-8-api&usg=ALkJrhg1cghWZHNUFgyt_rkUFKS-rwesmwException C ++ 14 vs C ++ 98 - c ++"C2D_message is not unique" when trying to make an apk sign - androidNavigation in Xamarin.Forms - c #FirebaseJobDispatcher starts when network changes - androidSlack Jenkins plugin not working - jenkinsAll Articles