검색어 입력폼

[링크드 리스트] linked-list

등록일 2002.11.29 파일확장자어도비 PDF (pdf) | 26페이지 | 가격 1,000원

목차

없음

본문내용

Why Linked Lists?
Linked lists and arrays are similar since they both store collections of data. The
terminology is that arrays and linked lists store "elements" on behalf of "client" code. The
specific type of element is not important since essentially the same structure works to
store elements of any type. One way to think about linked lists is to look at how arrays
work and think about alternate approaches.
Array Review
Arrays are probably the most common data structure used to store collections of
elements. In most languages, arrays are convenient to declare and the provide the handy
[ ] syntax to access any element by its index number. The following example shows some
typical array code and a drawing of how the array might look in memory. The code
allocates an array int scores[100], sets the first three elements set to contain the
numbers 1, 2, 3 and leaves the rest of the array uninitialized...
void ArrayTest() {
int scores[100];
// operate on the elements of the scores array...
scores[0] = 1;
scores[1] = 2;
scores[2] = 3;
}
다운로드 맨위로