1) An example of cheating would be storing formulas on a calculator using them on a test
2) An XE is the grade for failing a course due to academic dishonesty
3) Getting an E on the assignment is also a possibility besides getting an XE
4) The AIP file is stored in the dean's office
5) 6 years or until the student gradulates, whichever comes first
6) Misrepresenting your abilities is unfair to an employer
Andrew Wilcox's Student Blog
Thursday, September 30, 2010
Wednesday, September 22, 2010
isSorted() Program
bool isSorted(int list[] ,int n)
{
bool done = false;
int index = 0;
while ( !done && ( index < n - 1) )
{
if (list[index] > list[index + 1]) // if not sorted...
{
done = true;
}
index++;
}
// done is TRUE if list is not sorted, and FALSE if sorted.
return !done;
}
This solution should work for any n, because it compares from (0 and 1) to (n-2 and n-1)
This solution should work for any array of numbers as it compares two neighboring elements regardless of what is stored in them
This solution should work for any permutation of those numbers. If a number is greater than its successor then FALSE is returned, if each number is smaller than its successor then TRUE is returned
This Program will terminate in n time as after size-1 iterations the while loop will terminate
{
bool done = false;
int index = 0;
while ( !done && ( index < n - 1) )
{
if (list[index] > list[index + 1]) // if not sorted...
{
done = true;
}
index++;
}
// done is TRUE if list is not sorted, and FALSE if sorted.
return !done;
}
This solution should work for any n, because it compares from (0 and 1) to (n-2 and n-1)
This solution should work for any array of numbers as it compares two neighboring elements regardless of what is stored in them
This solution should work for any permutation of those numbers. If a number is greater than its successor then FALSE is returned, if each number is smaller than its successor then TRUE is returned
This Program will terminate in n time as after size-1 iterations the while loop will terminate
Wednesday, September 15, 2010
Checking an array for a certain value
bool isMatch(int list[] ,int num)
{
bool exist = false;
for (int index = 0; index <= sizeof(list); index++)
{
if (num == list[index])
{
exist = true;
}
}
return exist;
}
This code will terminate because the for loop ends once index has been exceeded the number of elements in the array.
This code will always return a correct result since the returned value remains false unless at least 1 element in the array is the same as the one we are looking for.
{
bool exist = false;
for (int index = 0; index <= sizeof(list); index++)
{
if (num == list[index])
{
exist = true;
}
}
return exist;
}
This code will terminate because the for loop ends once index has been exceeded the number of elements in the array.
This code will always return a correct result since the returned value remains false unless at least 1 element in the array is the same as the one we are looking for.
Sunday, September 12, 2010
Code for finding the minimum value in an array:
int findMin (int list[])
{
int minimum = list[0];
int size = list.length();
for (int index = 1; index < size; index++)
{
if (minimum > list[index])
{
minimum = list[index];
}
}
return minimum;
}
This program assigns the value stored in the first element to minimum and compares it with the next element (if it exists) and if the new value is smaller than the old value it replaces it. next the index is incremented by 1 and a new value is compared. This repeats until every element in the array has been examined.
This algorithm will always terminate as size must always be a positive finite integer and index will eventually no longer be smaller than it
Update 9/13/10:
This program will always return the minimum value because it iteration of the loop compares the value stored in minimum to list[index] and if the new value is smaller the minimum is updated. by the end of the loop minimum will be equal to the smallest value stored in the array.
int findMin (int list[])
{
int minimum = list[0];
int size = list.length();
for (int index = 1; index < size; index++)
{
if (minimum > list[index])
{
minimum = list[index];
}
}
return minimum;
}
This program assigns the value stored in the first element to minimum and compares it with the next element (if it exists) and if the new value is smaller than the old value it replaces it. next the index is incremented by 1 and a new value is compared. This repeats until every element in the array has been examined.
This algorithm will always terminate as size must always be a positive finite integer and index will eventually no longer be smaller than it
Update 9/13/10:
This program will always return the minimum value because it iteration of the loop compares the value stored in minimum to list[index] and if the new value is smaller the minimum is updated. by the end of the loop minimum will be equal to the smallest value stored in the array.
Sunday, September 5, 2010
Merge Sort
Merge sort is a divide and conquer sorting algorithm that uses recursion to reattach the individual elements into the proper order. It starts off by separating the starting array into two halves and then calls itself until there are n arrays that contain only 1 element. Next, the algorithm looks at the first (and smallest) element of the last 2 arrays that were split and picks the smaller value first and repeats until both arrays are empty. Then because of recursion the parent array is recombined in a smallest to largest order and so on until the entire array is sorted.
The advantages of merge sort is that it has a worst-case scenario of Θ(n ln n) and is useful for online sorting because it does not need to receive data all at once,
The advantages of merge sort is that it has a worst-case scenario of Θ(n ln n) and is useful for online sorting because it does not need to receive data all at once,
Wednesday, September 1, 2010
Transition into ASU
After I graduated high school in went to a community college located in Grand Rapids, Michigan; which is around where I lived at that time. When my family moved to Arizona, I moved with them and enrolled in ASU. Starting out at ASU was rough for me since I stilled lived at home when I was enrolled at GRCC and it was the first time I was separated from all my friends and family. To complicate the matter further, ASU tends to treat transfer students as lesser beings compared to incoming freshmen. Now, after a couple years in ASU, I have managed to get my act mostly together and have adapted to my new, and current, life.
Subscribe to:
Posts (Atom)