=====
CS 111 - Week 5 Lecture 2 - 2025-09-25
=====
=====
TODAY WE WILL:
=====
* announcements
* example involving itemization-style data
* intro to the idea of data structures
* intro to LISTS
* prep for next class
=====
* should be working on Homework 4!
* submit early, submit often!
=====
a DATA STRUCTURE lets us collect MULTIPLE instances within
a single collection-thing
=====
* programming languages frequently provide some "core"
data structure types;
* in Racket, arguably the most "basic" data structure type is
a list
* in C++, arguably the most "basic" data structure type
is a 1-dimensional array
* in problem solving, if you choose an appropriate choice
of data structure, it makes programming your solution
a LOT easier!
=====
BSL Racket's list data type
=====
* a built-in data type
* BUT - it is easiest to describe in an itemization-style way:
;=====
; DATA DEFINITION
; an Anything is an expression of any type
;=====
; DATA DEFINITION
; a list is one of:
; * empty
; * (cons Anything list)
* this is a SELF-REFERENTIAL data definition!!!!
* it DOES define a list in terms of a list...!
* BUT: it has a "base", at least one item in the itemization
that is NOT defined in terms of a list
...and if you "took apart" a list using the above definition,
you'd eventually reach one of the "base" items
* see more about BSL Racket's list data type in the posted
examples for today!