Kyle Pryslopski's Opus
In this space you can provide a description of yourself, your pursuits, your interests. To fill out this section, click the edit button off to the right, delete this placement text, and type your original content.
First day of class. We went over the syllabus and learned about the opus(EVIL) as well as the portfolio.
We played with linked lists thats all I can remember.
On one of these days Matt let us work on things and he put out small fires and babies.
Today is the last class in the month of September. We are working on stacks at the same time I am working on the opus(EVIL). Matt can't decide what he wants to do. First In Last Out or Last In First Out.
Version Control is a system used to track and control changes to a projects's files, in particular to source code, documentation, and web pages.
Commit- Is used to make a change to a project; more formally, to store a change in the repository in such a way that it can be incorporated into future releases of the project.
Checkout- The process of obtaining a copy of the project from a repository.
Update- To ask that others' commits be incorporated into your local copy of the project; that is, to bring your copy “up-to-date”.
Add- Inputs a file into a list of files to be tracked before a commit is made.
Log- A reminder attached to each commit, describing the nature and purpose of the commit.
Pointers- Point loctations in memory.
Address of- Can be represented by '&' and is what the pointer points to.
Assingment- Points two pointers to the same pointee.
Deferencing- Follows the arrow from the pointer to the pointee.
Void Pointers- Pointers that do not have a type so they can point to any data type.
Pointer Arithmetic - Only addition and subtraction operations are allowed to be conducted on pointers.
ex) cha++;
Array- It is the same concept as pointers, the identifier of an array is equivalent to the address of its first element, as a pointer is equivalent to the address of the first element that it points to.
Null Pointers- A regular pointer of any type which has a special value that indicates that it is not pointing to any valid reference or memory address, the value is the result of type-casting the integer value zero to any pointer type.
Function Pointers- Passing a function as an argument to another function, since these cannot be passed dereferenced in order to declare a pointer to a function we have to declare it like the prototype of the function, except that the name of the function is enclosed between parentheses () and an asterisk is inserted before the name.
ex) (*proto)(char,char);
Static allocation vs. Dynamic allocation- Statically allocated variables have their storage allocated and initialized before main starts running and are not deallocated until main has terminated. Dynamic allocation the program determines how much memory it needs at run time, and allocate exactly the right amount of storage.
Memory allocation (malloc(), new)- malloc is a subroutine for performing dynamic memory allocation in the C and C++ programming languages, though its use in C++ has been largely superseded by operators new and new[]. malloc is part of the standard library for both languages and is declared in the stdlib.h header although it is also declared within the std namespace via C++'s cstdlib header.
Memory De-allocation (free(), delete)- The delete operator calls the destructor of the given argument, and returns memory allocated by new back to the group. A call to delete must be made for every call to new to avoid a memory leak. After calling delete the memory object pointed to is invalid and should no longer be used. Many programmers assign 0 (null pointer) to pointers after using delete to help minimize programming errors.
Structures- A structured type that aggregates a fixed set of labelled objects, possibly of different types, into a single object. A struct declaration consists of a list of fields, each of which can have any type. The total storage required for a struct object is the sum of the storage requirements of all the fields, plus any internal padding.
Structure pointer- Pointers can be used to refer to a struct by its address. This is particularly useful for passing structs to a function by reference.
Linked Lists- a way to store data with structures so that the programmer can automatically create a new place to store data whenever necessary.
Discuss the representation and use of primitive data types and built-in data structures
How well I have done understanding what we have done in class.
What I have learned is how to make and edit a linked list.
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.
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.
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.
First class of October and yeah stuff going on. Just to remind Matt I will not be here friday. Function Pointers.
I do not know what we did on friday so today is up in the air for me. Sideways stacks yo? Now we work and this is fine with me.
Week eight and working on stuff and waiting for one email from a teacher. Joe's class was cancelled :), poor Joe.
First day of the last full week of October. Signals!!!
Doubly Linked Lists- Linked data structures that consists of a set of sequentially linked nodes. Each node contains two fields that are references to the previous and to the next node in the sequence of nodes. The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator, typically a sentinel node or null, to facilitate traversal of the list.
Stack- Last in, first out (LIFO) abstract data type and data structure. Can have any abstract data type as an element, but is characterized by only three fundamental operations: push, pop and stack top.
Array-based- A certain amount of memory is determined before used.
Linked List-based- Memory is not determined before hand but can be.
Pushing- Adds a new item to the top of the stack, or initializes the stack if it is empty. If the stack is full and does not contain enough space to accept the given item, the stack is then considered to be in an overflow state.
Popping- Removes an item from the top of the stack. A pop either reveals previously concealed items, or results in an empty stack, but if the stack is empty then it goes into underflow state (It means no items are present in stack to be removed).
Top- gets the data from the top-most position and returns it to the user without deleting it. The same underflow state can also occur in stack top operation if stack is empty.
Overflow condition- When the stack is full and can not take any more input. Push is the cause of this.
Underflow condition- When the stack has no data in it. Pop and Top cause this.
LIFO or FIFO?- Stacks are a LIFO.
Queues- particular kind of collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position and removal of entities from the front terminal position. This makes the queue a First-In-First-Out (FIFO) data structure.
Array-based- A certain amount of memory is determined before used.
Linked List-based- Memory is not determined before hand but can be.
Enqueuing- Placing an item in a queue.
Dequeuing- Removing an item from a queue.
Overrun conditions- When the queue is full and can not take any more input.
Underrun conditions- When the queue has no data in it.
Describe how the data structures are allocated and used in memory
The definitions on the opus.
The definitions are very well done.
What happens when you try to delete a number by zero?
My grandmother had an error message that got me thinking about this.
I think that if a program was made to do this it would get a seg fault or a zero as the answer.
#include<stdio.h> int main() { int num; num = 0; printf("Please enter a value: "); scanf("%d", &num); num = num / 0; printf("The answer is: %d\n", num); return(0); }
Please enter a value: 9 Floating point exception
Based on the data collected: My hypothesis was worng.
Dividing by zero, you will not get what you thing you should.
What do you need to do to get decimals in a math program?
Experiment 1 B
All you need to do is change any ints in the program to floats.
#include<stdio.h> int main() { float a = 0; float b = 0; float c = 0; float d = 0; float e = 0; float num = 0; printf("Please enter a value for a: "); scanf("%f", &a); printf("Please enter a value for b: "); scanf("%f", &b); printf("Please enter a value for c: "); scanf("%f", &c); printf("Please enter a value for d: "); scanf("%f", &d); printf("Please enter a value for e: "); scanf("%f", &e); num = ((a + b) * (c - d)) / e; printf("The answer is: %f\n", num); return(0); }
The answer to the problem ((1+2) * (3-4)) / 5 = 0(with ints) or 1(with floats)
Based on the data collected: My hypothesis was wrong.
What you really need to do is change all ints to floats and change all (%d)s to (%f)s.
6/2(1+2)=?
Tyler.
The answer is 1.
#include<stdio.h> int main() { int num; num = 6 / 2 * (1 + 2); printf("The answer is: %d\n", num); return(0); }
The computer has a certain way of answering the problem.
Based on the data: My hypothesis was wrong.
People can not agree on an answer.
Work day.
Bubbles and pie oh and no Karl. Happy thoughts.
Work on stuff and played cards, won the first game.
Trying to finish the Opus and got the EOCE.
LIFO or FIFO?- Queues are FIFO.
Computational Complexity- a branch of the theory of computation in theoretical computer science and mathematics that focuses on classifying computational problems according to their inherent difficulty, and relating those classes to each other.
Big O notation- used to describe the limiting behavior of a function when the argument tends towards a particular value or infinity, usually in terms of simpler functions.
Theta- the function, f(n) is bounded both from the top and bottom by the same function, g(n).
bounds- Upper and lower bounds, observed limits of mathematical functions.
Sorting Algorithms- an algorithm that puts elements of a list in a certain order.
Selection sort algorithm- a sorting algorithm, specifically an in-place comparison sort.
Bubble sort algorithm- also known as sinking sort, is a simple sorting algorithm that works by repeatedly stepping through the list to be sorted, comparing each pair of adjacent items and swapping them if they are in the wrong order.
Insert sort algorithm- a simple sorting algorithm: a comparison sort in which the sorted array (or list) is built one entry at a time.
Quick sort algorithm- a sorting algorithm developed by Tony Hoare that, on average, makes O(nlog n) (big O notation) comparisons to sort n items. In the worst case, it makes O(n2) comparisons, though this behavior is rare.
Merge sort algorithm- an O(n log n) comparison-based sorting algorithm. Most implementations produce a stable sort, meaning that the implementation preserves the input order of equal elements in the sorted output. It is a divide and conquer algorithm.
Binary Search algorithm- finds the position of a specified value (the input “key”) within a sorted array
Trees- a widely-used data structure that emulates a hierarchical tree structure with a set of linked nodes.
Binary Trees- a tree data structure in which each node has at most two child nodes, usually distinguished as “left” and “right”.
nodes- a structure which may contain a value, a condition, or represent a separate data structure (which could be a tree of its own).
parents- A node that has a child.
children- Each node in a tree has zero or more child nodes, which are below it in the tree (by convention, trees are drawn growing downwards).
insertion- the inserting of a node into a tree in a certain spot.
State the course objective; define what that objective entails.
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Follow your method and obtain a measurement. Document the results here.
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
Does a computer know that a negative number raised to an even power will make an even answer?
Internet.
I believe that a computer is not able to compute that without ()'s.
#include<stdio.h> #include<math.h> int main() { int x, y, z = 0; printf("Please input a x value. \n"); scanf("%d", &x); printf("Please input a y value. \n"); scanf("%d", &y); z = pow(x,y); printf("The value for z is: %d\n", z); return(0); }
The computer does know how to but if the x is raised to a -y it dont.
Based on the data collected: My hypothesis was wrong.
I should not underestimate the power of a computer.
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.
If you're doing an experiment instead of a retest, delete this section.
If you've opted to test the experiment of someone else, delete the experiment section and steps above; perform the following steps:
Whose existing experiment are you going to retest? Prove the URL, note the author, and restate their question.
Evaluate their resources and commentary. Answer the following questions:
State their experiment's hypothesis. Answer the following questions:
Follow the steps given to recreate the original experiment. Answer the following questions:
Publish the data you have gained from your performing of the experiment here.
Answer the following:
Answer the following: