Answers
|
A numbering system is a way to count things and perform arithmetic. |
|
|
The binary numbering system is a number system that uses two digits to count things and perform arithmetic. |
|
|
The purpose of an abstract data type is to specify the amount of memory needed to store data and the kind of data that will be stored in that memory location. |
|
|
A variable is a reference to the memory location that you reserved using the declaration statement. |
|
|
The integer abstract data type group consists of four abstract data types used to reserve memory to store whole numbers. |
|
|
The term “floating-point” refers to the way in which decimals are referenced in memory. There are two parts of a floating-point number. The first part is the real number, which is stored as a whole number. The second part is reference to the position of the decimal point within the whole number. |
|
|
A character is represented as an integer value that corresponds to a character set. A character set assigns an integer value to each character, punctuation, and symbol used in a language. |
|
|
Single precision refers to the accuracy of the first 7 numbers to the right of the decimal point. Double precision refers to the accuracy of the first 15 numbers to the right of the decimal point. |
|
|
A structure definition is like a cookie cutter in that it describes the shape of something. A cookie cutter describes the shape of a cookie. A structure definition describes the size and data type of a group of primitive data types. You use a cookie cutter to make cookies. You use a structure to declare an instance of the structure in memory. |
|
|
A structure is a user-defined data type. |
|
|
An element of an instance of a structure is referenced by using the dot operator, such as myStudent.grade. |
|
|
Keyword class, class name, and class body. |
|
|
A class definition defines both data and methods/functions. A structure definition defines only data. |
|
|
The hexadecimal numbering system consists of 16 digits that are represented as 0 through 9 and A through F. |
|
|
An address of a variable is assigned to a pointer variable by using the address operator (&). |
|
|
A pointer variable stores the address of another memory location. |
|
|
Pointers are used to step through memory sequentially by using pointer arithmetic and the incremental (++) or decremental (- -) operator. The incremental operator increases the value of a variable by 1 and the decremental operator decreases the value of a variable by 1. |
|
|
A pointer to a pointer is also a variable that contains a memory address except a pointer to a pointer contains the memory address of another pointer variable. |
|
|
An array element is similar to one variable except it is identified by the name of the array and an index value. |
|
|
An index value is a number used to identify an array element. |
|
|
An array of pointers is nearly identical to a pointer variable except each array element contains a memory address. |
|
|
A multidimensional array consists of two or more arrays defined by sets of array elements. Each set of array elements is an array. |
|
|
A multidimensional array is useful in some situations to organize subgroups of data within an array. |
|
|
There is a close-knit relationship between a pointer and an array. The array name is like a pointer variable in that the array name by itself references the address of first element of the array. |
|
|
A stack and an array are two different things. An array stores values in memory. A stack tracks which of the array elements is at the top of the stack. |
|
|
Push is the action that places data on a stack. |
|
|
Pop is the action that removes data from a stack. |
|
|
The value of the top index is –1. |
|
|
The value of the top index is equal to the number of elements in the array minus 1. |
|
|
A queue is a sequential organization of data. A queue is like the checkout line at the supermarket where the first customer is at the front of the line and the second customer is next in line, and so on, until you reach the last customer who is at the back of the line. |
|
|
Data organized in a queue is stored in an array or a linked list. |
|
|
A circular queue is a queue implemented using an array. When the elements at the end of the array are used up, you start over at the beginning so the queue chases itself around in a circle. |
|
|
The modulus operator can be used to make a linear pattern into a circular pattern. When the last element is used up, the modulus operator will take you back to the first element. |
|
|
When you don’t know the number of nodes ahead of time. The linked list implementation is only limited by the amount of memory on the machine. |
|
|
Enqueue is the action that places data on a queue. |
|
|
Dequeue is the action called that removes data from a queue. |
|
|
A linked list is a data structure that makes it easy to rearrange data without having to move data in memory. |
|
|
An entry in a linked list is called a node. |
|
|
Each member of a node points to the next node in the linked list. |
|
|
A doubly linked list is a linked list where each member of a node points to the previous node and to the next node in the linked list. |
|
|
A doubly linked list is used to enable a program to move up and down the linked list. |
|
|
A structure definition is used to define a node of a linked list. |
|
|
Declare a temporary pointer to the node being deleted. Change the next pointer in the previous node to the value of the next pointer in the node being deleted. Change the previous pointer in the next node to the value of the previous pointer in the node being deleted. Delete the node. |
|
|
Declare a temporary pointer to the front node. Change the value of the front pointer to the next pointer in the node being deleted. Change the value of the previous pointer in the next node to NULL. Use the temporary pointer to delete the node. |
|
|
Use the back pointer to get a reference to the last node on the linked list. Change the value of the next pointer in the back node to the address of the new node. Set the previous pointer of the new node to the current back node. Change the back pointer to the address of the new node. |
|
|
Use the front pointer to get a reference to the first node on the linked list. Change the value of the previous pointer in the front node to the address of the new node. Set the next pointer of the new node to the current front node. Change the front pointer to the address of the new node. |
|
|
The front and back pointers are both NULL. You only need to check one of them. |
|
|
The front and back pointers both point to the same node. |
|
|
The size is limited by the amount of memory on the machine. |
|
|
The destructor typically releases all the memory that was allocated for the linked list. |
|
|
A hashtable is a common data structure used to store objects that have a key value relationship. |
|
|
A key is translated into a number that is used as the array index of the array element that references the value that is associated with the key. |
|
|
Hashing is the process of translating the key into the array index of the array element that references the value that is associated with the key. |
|
|
Hashing produces a hash value. |
|
|
There is no real significance of a hash value other than it is a number used as an array index. |
|
|
Hashing is not perfect. Occasionally, a collision occurs when two different keys hash into the same hash value and therefore are assigned to the same array element. |
|
|
A common way to deal with a collision is to create a linked list of entries that have the same hash value. |
|
|
In the most ideal case, the hash function should produce an even distribution of values for a given set of keys. The result is a minimum number of collisions. |
|
|
Hashing typically uses bit shifting to pseudo-randomize the generated values. How could you deal with this? |
|
|
You could make the hashtable array larger, then rehash all the keys and insert them accordingly into the new hashtable. |
|
|
Call the hashing algorithm with the key. Go to the array and see if the value in the array index is NULL. If it is, then change this value to the address of the new node. If the array index is not NULL, then set the next pointer in the new node to the value at the array index and set the array index to the address of the new node. This makes the new node the first entry in the linked list. |
|
|
Call the hashing algorithm with the key. Go to that index in the array. Traverse the linked list and find the value, and then delete this entry from the linked list. The entry is deleted by setting the next pointer in the previous node to the next pointer of the node being deleted. |
|
|
Call the hashing algorithm with the key. Go to that array index and traverse the linked list until you find that key. Return the associated value. |
|
|
Iterate the array. At each index, if it contains a value other than NULL, iterate the linked list and list out the values. |
|
|
Iterate the hashtable array and see if all the values are NULL. If all the values are NULL, the hashtable is empty. |
|
|
A binary tree is a tree where each stem has not more than two branches Typically the stem has two branches, but there can be situations when the stem has one branch or simply terminates resulting in no additional branches. |
|
|
The branch node is the fork in the road that links the root node to two branches. |
|
|
The starting node is called the root node, which is the top-level node in the tree. |
|
|
A parent node spawns another node in a binary tree. |
|
|
Nodes at the end of a binary tree are called leaf nodes. |
|
|
Ten. 2^10 ~= 1000. |
|
|
The depth is the number of hops to get to the “lowest” node in the tree. |
|
|
2^n – 1 where n is the depth of the tree. |
|
|
Both the child node pointers are set to NULL. |
|
|
Replace the node being deleted with the leftmost child of the right subtree. You could also replace it with the rightmost child of the left subtree. |
|
|
Change the value of the pointer in the parent node to the value of the child node, and then delete the node. |
|
|
Change the value of the pointer in the parent node to NULL, and then delete the node. |
|
|
All the nodes to the right have a key greater than the current node and all the nodes to the left have a key less than the current node. This rule applies to each and every node of the tree. |
|
|
Start at the root of the tree. If the key is greater than this node, move to the right. If the key is less than this node, move to the left. Continue until a NULL pointer is found, and then change the value of this pointer to the address of the new node. |
|
|
The tree is empty if the root node of the tree is NULL. |
|
|
A recursive function is a function that calls itself. |
|
|
One of two conditions—either the key is found or a NULL pointer is found. |
|
|
For each node, look to the left, process the node, and then look to the right. |
|
|
A pointer is a variable whose value is an address of a location in memory. |
|
|
Memory allocation is the task of reserving memory in order to store data in memory. |
|
|
The new operator returns an address of memory. |
|
|
It is a misnomer that Java doesn’t use pointers. Java does use pointers, but a programmer doesn’t explicitly declare pointers. You can declare an array whose data type is a Java Object—an array of pointers. The value of each array element is an Object. When you switch those values to other array elements, you are moving memory addresses and not the Object itself. |
|
|
An array of pointers is declared by preceding the array name with an asterisk. |
|
|
An array of pointers to pointers is declared by preceding the array name with two asterisks. |
|
|
An int pointer is incremented by the number of bytes of an int. |
|
|
The number of nodes on the tree defines a binary tree’s depth. |
|
|
A balanced binary tree is where each node except for a leaf node has two children nodes. |
|
|
No. |
|
|
The key and the search criteria are compared to each other. |
|
|
“Metadata” is the term that refers to data that describes other data such as how an employee ID can be used to get the employee’s name. |
|
|
The this operator tells the compiler that you want to refer to the data element of this instance of the structure instead of the parameter that was passed in. |
|
|
Members defined within the private access specifier area of the class definition can only be accessed by member functions of the class. |
|
|
This statement assigns the NULL value to the next node’s previous pointer. |
|
|
First in, first out. |
|
|
Members defined within the public access specifier area of a class definition can be accessed by member functions of the class and from outside the class. |