User Tools

Site Tools


notes:data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:data [2017/11/11 11:49] – [Data Structures Course Notes] bstrong2notes:data [2018/10/24 23:39] (current) – [URLs] ktodd3
Line 1: Line 1:
-======Data Structures Course Notes====== +<WRAP centeralign round box> 
-week 11\\+<WRAP><color red><fs 200%>Corning Community College</fs></color></WRAP> 
 +<WRAP><fs 150%>CSCS2320 Data Structures</fs></WRAP> 
 +<fs 125%>Course Wiki Page</fs> 
 +</WRAP>
  
-11/7/2017 \\ +======Projects====== 
-Stacks - Last in, First out - pez dispenser \\ +dsi0 
-Queues - First in, First out - lines, waiting for something, usually first person gets first pick \\ +ael0 
--Andrei+======URLs====== 
 +Binky Pointer Video:
  
 +[[https://www.youtube.com/watch?v=f-pJlnpkLp0|Binky Pointer Video]]
  
-Class of November 9th 2017+[[https://www.learn-c.org/en/Linked_lists|Basic linked list tutorial ]] 
 +======Notes====== 
 +====Pointers:====
  
-Today in class we wen't over more about the upcoming “tree's”, as well as some notation's that can be used that are more efficient in c. We also talked a little bit about the EOCE (the fact that it's on its way). As well as the next class that hass is teaching, comp org.+char x = 0;
  
-Tree'sThe 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 leftparent, 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.+char -> 1 byte (8 bits) 
 +Default char -> signed (2^8 -> 256 -> -128+127 [one is used for positive/negative value])
  
-Pol Notation- We wen't over this briefly, but enough to get the premise down. Here is link to a wiki page about it [[https://en.wikipedia.org/wiki/Reverse_Polish_notation]].+the asterisk (*) indicates "pointer" 
 +    signed char *y = NULL; 
 +                ^ 
 +                                 
 +(void*)0 
 +Void pointers are raw memory
  
-If you are taking Computer Organization next semester, and want to get a head start, then get some practice with [[Intel 64 Bit Assembly]]. +    |0| 
-=====week 1=====+    --- 
 +    x 
 +    0xdeadbeef 
 +       |NULL(0)| 
 +       --------- 
 +       y 
 +       0xcoffee 
 +        
 +Access an address with &
  
-=====week 2===== +Make y deadbeef without using "deadbeefby using the address (&) my man.
-Nodes are structures that contain data and also can point and "linkto another node, creating a list.+
  
-Nodes do not necessarily need to be a named variablebut rather can be pointed to by variables that can be moved depending if the list has been changed.(ie. start&tmp)+   y = &x 
 +Nowy's data is the address of x.
  
-Ternary statements= "(condition) ? statementiftrue : statementiffalse;"+x contains the data '0'
  
-To free memoryuse free() then set to null;  ex: free(tmp)tmp NULL;+If we do this: 
 +    |0| 
 +    --- 
 +    x 
 +    0xdeadbeef  <- address 
 +       |0xdeadbeef| 
 +       ------------ 
 +       y 
 +       0xcoffee <- address 
 +        
 +   x = 7; 
 +   *y 13;
  
 +Then:
 +    |13|
 +    ----
 +    x
 +    0xdeadbeef  <- address
 +       |0xdeadbeef|
 +       ------------
 +       y
 +       0xcoffee <- address
  
-=====I dunno lol===== +is now 13 because y is x's address, and you 'pointed' 13 to the address. Illdog.
-"List" in sll0 is just an "engine" and "caboose", which are pointers (like tmp) to "start" and "end"therefore "mklist()" is super easy to use+
  
-=====whaaat===== 
---i increments before loop, i-- increments after first iteration 
  
 +Double pointers are arrays or whatever
 +    |          |
 +    ------------
 +    z
 +    
 +    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 are 8 bytes on 64 bit linux systems.
 +4 bytes on 32 bit linux systems.
 +======Other======
notes/data.1510418945.txt.gz · Last modified: 2017/11/11 11:49 by bstrong2