In an interview, when I ask recent graduate students what the difference is between an array and a linked list, the first answer is usually "You have the same data types in the array, and you can have different data types in the linked list." When I told them to explain that they would say that they had just read it or that they didnโt know for sure. I really donโt understand where this idea comes from in their brain. Can someone help me understand why a college graduate considers this? Or do you think this is really the difference?
It is possible that these students were taught arrays with statically typed languages โโand linked lists with dynamically typed languages, so they came to identify the data structure with the paradigm of the language in which they used it.
For example, they could use arrays in C and related lists in Schema. Or no matter how fashionable names are for today's languages, which are essentially similar to C, respectively Scheme.
, , , . , . , , ... ... .
, , :
, -
int[] myArray = new int[20];
, , ...
node
prev= object; next = object;
, .
. , .
P.S: , ... , -:)
, perl, ... perl list . , c void *, , void.
, , , , . ( , , , , ). , , , , , , .
Source: https://habr.com/ru/post/1763217/More articles:iPhone: TabBar Overrides UIScrollView - iphoneJava Policy Based Development - javaHow to update existing status bar notifications when changing locales - androidProgrammatically add reminder to Android calendar? - androidAlarmManager at specific dates and times - androidFile Storage - databaseRegular expressions match any string between [and] - c #three or more roots in js - javascriptActs like Taggable On: translate tags - ruby-on-railsWPF style trigger problem - wpfAll Articles