This is an old revision of the document!
Data structures is a hard class to take with out computers…
This week was very uneventful due to the above statement. Matt reviewed some topics from our past prerequisite classes to help us get up to pace with what will be needed in our first project. This had me inspired and i started working!
#include <stdio.h> int main() { int choice = 0; printf ("1) Build List\n"); printf ("2) Display List\n"); printf ("3) Instert Into List\n"); printf ("4) Append Into List\n"); printf ("5) Obtain From List\n"); printf ("6) Clear List\n"); printf ("7) Quit\n"); return 0; }
Underwhelming! :D
#include <stdio.h> int main(){ int test [20]; int choice = 0; do{ printf ("1) Build List\n"); printf ("2) Display List\n"); printf ("3) Instert Into List\n"); printf ("4) Append Into List\n"); printf ("5) Obtain From List\n"); printf ("6) Clear List\n"); printf ("7) Quit\n"); printf ("Enter option: "); scanf ("%d", &choice); if (choice > 7){ printf ("Non-existent Option\n"); } if (choice == 1){ printf ("enter numbers: "); int number = 0; int index = 0; int stop = -1; do{ if (index == 19){ test[index] = stop; printf ("number limit reached\n"); break; } else { scanf ("%d", &number ); test[index] = number; index++; } } while (number != -1); } else if (choice == 2){ int i; for (i = 0; i <= 19; i++){ int at = test[i]; if (at == -1){ printf ("# -1 @ array index %d\n", i); break; } else { printf ("# %d @ array index %d\n", at,i); } } } else if (choice == 3){ int nv, ai, in; printf ("enter new value: "); scanf ("%d", &nv); printf ("enter array index: "); scanf ("%d", &ai); printf ("nv %d ai %d\n", nv,ai); for (in =0; i <19 } } while (choice != 7); return 0; }
dsi0 is coming along and should be done tonight! W00t W00t.