notes:data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
notes:data [2017/11/14 16:37] – abratkov | notes:data [2018/10/24 23:39] (current) – [URLs] ktodd3 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Data Structures | + | <WRAP centeralign round box> |
- | 11/13/17 \\ | + | < |
- | If one does not understand how to write status codes or data structures with linked lists, one must fully realize that they will fail dlt0. Good luck mates \\ | + | < |
+ | <fs 125%> | ||
+ | </ | ||
- | -Andrei | + | ======Projects====== |
+ | dsi0 | ||
+ | ael0 | ||
+ | ======URLs====== | ||
+ | Binky Pointer Video: | ||
- | week 11\\ | + | [[https:// |
- | 11/7/2017 \\ | + | [[https://www.learn-c.org/ |
- | Stacks | + | ======Notes====== |
- | Queues - First in, First out - lines, waiting for something, usually first person gets first pick \\ | + | ====Pointers: |
- | -Andrei | + | |
+ | char x = 0; | ||
- | Class of November 9th 2017 | + | char -> 1 byte (8 bits) |
+ | Default char -> signed (2^8 -> 256 -> -128, +127 [one is used for positive/ | ||
- | Today in class we wen't over more about the upcoming “tree' | + | the asterisk (*) indicates |
+ | signed char *y = NULL; | ||
+ | ^ | ||
+ | |||
+ | (void*)0 | ||
+ | Void pointers are raw memory | ||
- | Tree's- The three tree's that we are doing is **In order traversal** which is navigating through the tree by parent, left, then right. Next is **Pre-Order traversal** this is where the order is left, parent, right. This gives you the values from least to greatest. The last one is **Post-Order traversal** which is going from right, parent, left, which gives you greatest to least values in the tree. | + | |0| |
+ | | ||
+ | x | ||
+ | 0xdeadbeef | ||
+ | | ||
+ | | ||
+ | y | ||
+ | | ||
+ | |||
+ | Access an address with & | ||
- | Pol Notation- We wen't over this briefly, but enough to get the premise down. Here is a link to a wiki page about it [[https:// | + | Make y = deadbeef without using " |
- | If you are taking Computer Organization next semester, and want to get a head start, then get some practice with [[Intel 64 Bit Assembly]]. | + | y = &x |
- | =====week 1===== | + | Now, y's data is the address of x. |
- | =====week 2===== | + | x contains the data ' |
- | Nodes are structures that contain | + | |
- | Nodes do not necessarily need to be a named variable, but rather can be pointed to by variables that can be moved depending if the list has been changed.(ie. start& | + | If we do this: |
+ | |0| | ||
+ | --- | ||
+ | x | ||
+ | 0xdeadbeef | ||
+ | | ||
+ | | ||
+ | y | ||
+ | | ||
+ | |||
+ | x = 7; | ||
+ | *y = 13; | ||
- | Ternary statements= " | + | Then: |
+ | |13| | ||
+ | ---- | ||
+ | x | ||
+ | 0xdeadbeef | ||
+ | | ||
+ | | ||
+ | y | ||
+ | | ||
- | To free memory: use free() then set to null; ex: free(tmp); tmp = NULL; | + | x is now 13 because y is x's address, and you ' |
- | =====I dunno lol===== | + | Double pointers are arrays or whatever |
- | " | + | | | |
- | + | ------------ | |
- | =====whaaat===== | + | z |
- | --i increments before loop, i-- increments after first iteration | + | |
+ | signed char **z = NULL; | ||
+ | |||
+ | So we're gonna give this some garbage | ||
+ | |0xcoffee| | ||
+ | ---------- | ||
+ | z | ||
+ | 0xc05fefe | ||
+ | And do nothing with it because we kind of just stopped I think. | ||
+ | |||
+ | Memory addresses | ||
+ | 4 bytes on 32 bit linux systems. | ||
+ | ======Other====== |
notes/data.1510695452.txt.gz · Last modified: 2017/11/14 16:37 by abratkov