Linked list: Difference between revisions
Mr. MacKenty (talk | contribs) |
Mr. MacKenty (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
In an array we are usually concerned about 2 things, the '''position''' (or the index) of an element and the element. | In an array we are usually concerned about 2 things, the '''position''' (or the index) of an element and the element. | ||
[[File:DataStructuresLinkedList.png]] | |||
== singly linked list == | == singly linked list == |
Revision as of 12:30, 5 December 2016
Arrays are a fundamental data structure, and they are extremely useful. We use arrays to hold values of the same type at contiguous memory locations. In particular, the use of arrays allows us to create "groups" or "clusters" of variables without needing to give a unique variable name to each, but still allowing us to individually index into the elements of the array. If you haven't started counting from zero yet, now is the time, because in C, arrays are zero-indexed which means the first element of a k-element array is located at array index 0 and the last element is located at array index k-1. In case you're wondering, that's the primary reason we count from 0 in CS50 (and in computer science more broadly!)[2]
In an array we are usually concerned about 2 things, the position (or the index) of an element and the element.
singly linked list[edit]
This video discusses the C programming language, but the content is clear to describe linked list.
doubly linked lists[edit]
This video discusses the C programming language, but the content is clear to describe linked list.
Standards[edit]
- Describe how linked lists operate logically.
- Sketch linked lists (single, double and circular).