Matrices Top Footnotes Contents

Footnotes

(1)
It seems odd that the compiler does not know about a function it should know about, since printf is built in. But C was designed to be a rather flexible language, so we will need to inform the compiler properly for reasons not worth going into at this time.
(2)
On Linux and other Unix-like systems, the standard header files are located in the /usr/include/ directory.
(3)
Executed is such a gruesome term, but it means run or performed. It derives from the idea of an executive performing the task indicated by the line of code.
(4)
More on command-line arguments in a later chapter.
(5)
Languages that do not allow changes to a variable are called functional languages, while those that do are called imperative languages. C is an imperative language.
(6)
Another fundamental concept of Computer Science is analogy and if you understand the purpose of the envelope story after reading this section, you're well on your way to being a Computer Scientist!
(7)
The third great fundamental concept in Computer Science is generalization. In particular, Computer Scientists are always trying to make things more abstract and more general (but not overly so). The reason is that software/systems/models exhibiting the proper levels of abstraction and generalization are much much easier to understand and modify. This is especially useful when you are required to make a last second change to the software/system/model.
(8)
Even the envelope metaphor can be confusing since it implies that two variables having the same value must each have a copy of that value. Otherwise, how can one value be in two envelopes at the same time? For simple literals, copying is the norm. For more complex objects, the cost of copying would be prohibitive. The solution is to storing the address of the object, instead of the object itself, in the envelope. Two variables can now "hold" the same object since it is the address is copied.
(9)
We will cover this in more detail in the chapter on Scope.
(10)
In the algebraic equation mx + b, the multiplication sign is elided, but most programming languages, C included, require the presence of the multiplication sign, For C, the multiplication sign is the asterisk.
(11)
The believed value of PI has changed throughout the centuries and not always to be more accurate (see http://en.wikipedia.org/wiki/History_of_Pi )
(12)
Actual addresses of memory locations in C are usually large numbers, typically displayed in octal or hexadecimal, rather than decimal.
(13)
The value is not really random. A better description would be detritus, the stuff left over from previous activities. The actual value found in an uninitialized variable are the bits left over from previous programs that used that memory location.
(14)
Computer Scientists, when they have to write their annual reports, often refer to the things they are reporting on as darkspace. It's always good to have a lot of darkspace in your annual report!
(15)
As you get more sophisticated in your C programming, you will likely take advantage of cpp, the C pre-processor. Using cpp, you can add constants to your C program.
(16)
Bits in the informal sense, not zeros and ones.
(17)
Not all data structures have this property of quick access to data. However, these other data structures, which you will learn about later, may have advantages over arrays in certain situations. Choosing the correct data structure for solving a problem is most of the work in crafting a solution.
(18)
There is one exception. Sometimes you will see an array created like this:

int x[512] = { 0 };

C, if given at least one initializer, will set all slots that are missing initializers to zero. This quirk of C makes it quite easy to initialize an array to all zeros.

(19)
A byte is eight bits. An integer is usually 4 or 8 bytes, depending on the system, while a double is usually 8 bytes.
(20)
Back in the day, when we wanted to look up the meaning of a word, we grabbed a dictionary that had been stored in the form of a book. A book was a device made of something called paper, which, more often than not, was made of pine trees.
(21)
The information that is passed into a function is collectively known as arguments. The arguments are then bound to the variables or formal parameters that are found after the function name in the function definition.
(22)
Many times, the printing is done to a file, rather than the console.
(23)
For variadic functions, which C allows for, the number of arguments may be more than the number of formal parameters. The built-in function printf is a variadic function.
(24)
We will learn about loops in the next chapter.
(25)
C doesn't care, but your instructor certainly does!
(26)
see http://en.wikipedia.org/wiki/Morris_worm.
(27)
In more modern versions of C, one can use the "%ms" directive and pass in the address of an uninitialized string pointer. In this case, scanf would dynamically allocate a sufficiently large character array, fill it, and set the pointer to point to the array. The caller of scanf would be responsible for freeing the array.
(28)
You will often see the term variable declaration instead of variable definition.
(29)
We will see the utility of the counting pattern for lists, for which we do not need the size, a priori.
(30)
The superior student will ascertain why this is so.
(31)
This happens if adding the last element causes the array to grow.
(32)
The readTokens function is more complex, but its complexity arises from the desire to not know the number of tokens in advance.
(33)
We can't use the alias Node yet, since the alias is set up once the entire node structure is processed. So inside the structure, we must use struct node.
(34)
This curious behavior is the basis for a somehting called a stack. You will learn about stacks in your next CS course.
(35)
When two variables, in this case a and items, point to the same thing, they are said to be aliases of one another.
(36)
Prepend is rather an awkward term, so that is why we will use join as the function name, rather than prepend.
(37)
The test condition of the while loop is the reason for the comment that the length of listA must be greater than zero.
(38)
Sometimes, destructive functions return a value for convenience to the caller, in which case this generalization fails.
(39)
Again, when an operation does not affect its operands, it is said to be non-destructive. The getListIndex function, since it never sets a pointer in the given list, is non-destructive
(40)
This idea of repeatedly inserting items in a list with the list remaining ordered is the basis for an important data structure, the priority queue. Priority queues are used in network connectivity algorithms and discrete-event simulations. You will learn about priority queues in a subsequent class
(41)
Actually, reversing the logic of greater than yields less than or equal, but we are ignoring situations when values match exactly. What happens in those cases is left as an exercise.
(42)
Mathematicians, being an inclusive bunch, like to invite zero to the factorial party.
(43)
Ellipses are the three dots in a row and are stand-ins for stuff that has been omitted.
(44)
If one views more multiplications as more complex, then, clearly, computing the factorial of n-1 is simpler than computing the factorial of n.
(45)
We'll see why the variable temp is needed in the next chapter.
(46)
A pineapple, the golden ratio, a chambered nautilus, etc.
(47)
13 is 7th Fibonacci number and seven is one more than six. A coincidence? Maybe...or maybe not!
(48)
The word is recurs, not recurses!
(49)
Yes, division is just repeated subtraction, just like multiplication is repeated division.
(50)
The loop variable is considered a outside variable changed by the loop.
(51)
A style of programming that uses no assignments is called functional programming and is very important in theorizing about the nature of computation.
(52)
Unfortunately, C is not a good language in this regard, but the language Scheme is. When the value of a recursive call is immediately returned (i.e., not combined with some other value), a function is said to be tail recursive. The Scheme programming language optimizes tail recursive functions so that they are just as efficient as loops both in time and in space utilization.
(53)
A three-dimensional array would be an array whose elements are arrays whose elements are arrays. Arrays of two dimensions and higher are known as multi-dimensional arrays.
(54)
This choice of the backbone representing the rows is purely arbitrary, but when this choice is made, the matrix is said to be row-ordered. If the opposite choice is made, that the backbone represents the columns, then the matrix is said to be column-ordered. Most programming languages provide row-ordered multi-dimensional arrays.

lusth@cs.ua.edu


Matrices Top Footnotes Contents