Ian's fall2012 Opus
opified by yours truly
My name is Ian I am originally from Elmira NY I now live in Corning with my Fiance and our two year old daughter. I am interested in a wide range of things I am in the computer science program and enjoy learning to program and I am in the pursuit of large sums of money ;)
This week was my first back in school in a little while and I am enjoying it. in data structures we started talking about pointers and writing small programs to test pointers and get familiar with them. in discrete structures we started on logic and started writing programs to implement the different boolean logic i picked converse non implication. Also in both classes we have been brushing up on / reviewing C which is never a bad thing the only challenges so far i feel I'm facing is the logic gate I guess also the size program in data where we had to test the size limits of the various data types but that is a good challenge and its always fun to try and solve problems and see peoples different approaches to the same problem.
This week we started working on linked lists and doubly linked list we wrote a linked list together than on our own we implemented differernt functions like append, insert, and remove we also started a doubly linked list and are going to be implementing the different functions for that as well. in discrete we refined our logic programs and started working on sets i choose to use a linked list to write my set program all in all good week plenty of things to keep me busy I also finished my keywords for discrete and data
This week we got our other random keywords that we need to work on and show an example of we worked more on linked lists which i am getting better at thier still a little tuff to just do without writting it out and tweaking logic we are also working on the doubly linked list more which is always fun but other than that we havent started on anything new yet we talked today about whats coming next stacks and queues. and are just finishing up doubly linked list
This week I finished my opus part 1 and finished my other keywords and experiment my experiment wasn't to special but I couldn't think of any others to do. In class we started writing a sort program to sort data and finished all the modifications on our singly linked list. next week as I understand it we will begin on doubly linked list insert and remove and work on our sort program so far so good happy about completing the first part of my opus
Function Pointers
Function Pointers are pointers that point to the memory location of a function and can be used to call and pass arguments to said function. This can be used when you might have a few functions and only one of them needs to be called but at the time of writing the program you don't know which one needs to be called.
Holds the address of another variable.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Declaring and using a class pointer */ #include <iostream> #include "class.h" using namespace std; int main() { class variable; class *classPointer = &variable; int localVariable; classPointer->classSetFunction(localVariable); return(0); }
Converse Nonimplication
Converse Non-implication is the negation of the reverse of implication. implication is if … then where it is only false if the first term “p” is true and the second term “q” is false so converse non-implication is only true if the first term “p” is false and the second term “q” is true
exclusive disjunction/nonequivalence
Exclusive disjunction means that only one can be true, but not both. It's basically an XOR.
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Exclusive Disjunction */ #include <stdio.h> int main() { int p; int q; int r; printf("Enter a 1 or a 0 to xor:\n"); scanf("%d", &p); printf("Enter a second 1 or 0:\n"); scanf("%d", &q); r=p^q; printf("The xor of the values you've entered is: %d",r); return(0); }
Can I pass a class pointer by reference?
*http://cboard.cprogramming.com/c-programming/109893-passing-pointers-reference.html *http://www.tutorialspoint.com/cplusplus/cpp_passing_pointers_to_functions.htm
*http://linuxconfig.org/c-understanding-pointers *http://stackoverflow.com/questions/1825794/passing-pointer-argument-by-reference-under-c
I feel a class pointer can be passed by reference just like a normal pointer
I am going to write a program and pass a pointer by reference.
1 #include <iostream> 2 3 4 Class A 5 { 6 public: 7 A(); 8 function(int **pointer) 9 10 private: 11 int variable; 12 int filler; 13 }; 14 15 void A::functionint(int **points) 16 { 17 int *points; 18 }
1 #include <iostream> 2 #include "class.h" 3 4 using namespace std; 5 6 int main() 7 { 8 class classVariable; 9 class *classPointer = &classVariable; 10 11 int variable1; 12 13 function(&classPointer); 14 15 return 0; 16 }
Based on the data collected:
Ive discovered that class pointers can be passed by reference the same as a local pointer.
This week in data structures we took are linked list program and broke it up into separate functions in separate files and had them pass nodes between them and create a menu for the program that could call each function on demand we then compiled them linked them together and where evaluated on them .In discrete we worked on are set program and are naive sort program I found the linked list project was a very good refresher on funtions and passing parameters between functions such as nodes and pointers
This week in discrete we starting writing a set program that takes in members than outputs them in set notation now we are modifying and improving that program to be menu driving and perform operations such as union, intersection and difference. in data we are finishing are modular menu driven doubly linked list and we have also started on a linked list based stack program.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
stack push operation
The push operation adds a new element to the top of the stack (FILO)First in Last Out
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
* http://www.cplusplus.com/reference/stl/stack/push/
* http://en.wikipedia.org/wiki/Stack_(abstract_data_type)
array vs. linked list (pros/cons)
An array is a simpler, easier format for multiple value storage. You do not need to go threw the list in an array, you can use that element of the array. Linked lists have no benefits.
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
proper subset
A subset is a set of members that when compaired with another set of members regardless of the sizes of either set it shares some but not all of the same members. a Proper subset is when the two sets of members are a subset but not equal
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
venn diagrams
A pictorial way to compare two things and also show what they have in common, often shown with two circles overlaying each other.
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
http://lab46.corning-cc.edu/~rthatch2/image.png
int main() {
return(0);
} </code>
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Is an an array dynamic ?
I know from class and compile errors its not and thats what makes a linked list useful
No memory needs to be allocated for the array so it has to be declared with a size and type
write a program that uses a variable in the array decliration like so : int myArray[size]
It actually compiled because its a logic error not a syntax error but the program did not work
Based on the data collected: my hypothesis was correct but that outcome is not what I expected I for some reason expected compiler errors
although would be nice due to the way the c compiler allocates memory arrays must be declared with a size
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
Remember that 4 is just the minimum number of entries. Feel free to have more.
Identification of chosen keyword.
Definition (in your own words) of the chosen keyword.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
A binary search tree can also be named as a sorted/ordered search tree. Its a tree that has nodes that stem off into small search trees. It uses a linked list (doubly) that goes left and right. Numbers are placed in the nodes throughout the tree and with the correct algorithm it can traversed through going least to greatest or vice versa. Generally the left tree will have values that are less then the root (starting node) and the right tree will have values greater. The first node is called the root and the final nodes (depending on where it ends) are considered the leaves of the trees since that are the last on the tree.
tree rebalancing
In computer science, a self-balancing (or height-balanced) binary search tree is any node-based binary search tree that automatically keeps its height (number of levels below the root) small in the face of arbitrary item insertions and deletions. These structures provide efficient implementations for mutable ordered lists, and can be used for other abstract data structures such as associative arrays, priority queues and sets.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Identification of chosen keyword.
Definition (in your own words) of the chosen keyword.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Turing machine
A Turing machine processes symbols on a strip of tape with a set of rules. A Turing machine is not really meant for practical use but more to help computer scientists understand the limits of mechanical computation. A hypothetical device to represent a computing machine.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Identification of chosen keyword.
Definition (in your own words) of the chosen keyword.
List any sites, books, or sources utilized when researching information on this topic. (Remove any filler text).
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
Demonstration of the indicated keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
What is the question you'd like to pose for experimentation? State it here.
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.