Image Filters in C
- 76Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
76 questions
- 1In C, a user-defined data type that groups related fields, such as a student's name and dorm, is called a_____.
Hint
Think of a custom record that combines multiple pieces of information.
Answer
struct
- 2The C keyword used to define an alias for a structure-based data type is_____.
Hint
It allows a programmer to define a convenient name for a type.
Answer
typedef
- 3In the student structure, the expression students[i].name uses the_____operator to access a field inside a structure.
Hint
This operator is written as a period.
Answer
dot
- 4A header file conventionally used to share structure definitions across multiple C programs typically ends with_____.
Hint
This is the conventional extension for a C header file.
Answer
.h
- 5The C function that opens a file and returns a reference to it is_____.
Hint
Its name combines the words file and open.
Answer
fopen
- 6In the file mode passed to fopen, the letter W indicates that the file is being opened for_____.
Hint
The corresponding mode for retrieving data is represented by R.
Answer
write
- 7The sentinel value used to indicate that fopen failed to produce a valid address is_____.
Hint
It represents the absence of a valid pointer or address.
Answer
NULL
- 8The function that prints formatted output to an opened file rather than to the screen is_____.
Hint
It is the file-oriented counterpart of printf.
Answer
fprintf
- 9Calling_____after writing to a file completes the file operation and releases the associated resource.
Hint
Its name combines file with the opposite of open.
Answer
fclose
- 10A comma-separated values file is commonly abbreviated as_____.
Hint
The abbreviation describes the way values are separated in the file.
Answer
CSV
- 11The region of memory that contains the compiled zeroes and ones of a program is called the_____segment.
Hint
Despite its name, this segment contains machine code rather than ordinary written text.
Answer
text
- 12Global variables that are assigned values when declared are stored in the_____data region.
Hint
The term describes variables that already have assigned starting values.
Answer
initialized
- 13Global variables that have not been assigned values are stored in the_____data region.
Hint
This is the opposite of initialized data.
Answer
uninitialized
- 14Values such as usernames and passwords that should not be stored directly in source code can be placed in_____variables.
Hint
These variables are supplied by the operating system or execution environment.
Answer
environment
- 15The memory region used for function calls, parameters, and local variables is the_____.
Hint
Each function call receives a new frame in this region.
Answer
stack
- 16The memory region used for dynamically allocated, longer-lasting storage is the_____.
Hint
malloc obtains memory from this region.
Answer
heap
- 17Each time a function is called, it receives a portion of stack memory called a stack_____.
Hint
It contains the function's local execution information.
Answer
frame
- 18After a function returns, its stack memory can be reused, so values left there are considered_____values.
Hint
These values were left behind by previous uses of the memory.
Answer
garbage
- 19The function used to request a dynamically allocated block of memory from the heap is_____.
Hint
Its name abbreviates memory allocation.
Answer
malloc
- 20The function used to release memory previously allocated with malloc is_____.
Hint
It returns allocated memory to the operating system for reuse.
Answer
free
- 21A program that allocates memory but does not return it with free can develop a_____leak.
Hint
The missing resource is allocated storage.
Answer
memory
- 22The function that allocates memory like malloc while also clearing the allocated bytes to zero is_____.
Hint
The C in its name refers to clearing the memory.
Answer
calloc
- 23The function that can resize an existing allocated memory block is_____.
Hint
Its name combines allocation with the idea of doing it again.
Answer
realloc
- 24A variable declared as int *x stores the_____of an integer rather than the integer itself.
Hint
It identifies where the integer is located in memory.
Answer
address
- 25The unary * operator applied to a pointer means to_____the address stored in that pointer.
Hint
It follows the pointer to access the value at its destination.
Answer
dereference
- 26The & operator is used to obtain the_____of a variable.
Hint
It produces the location that can be stored in a pointer.
Answer
address
- 27Passing the addresses of x and y to swap allows the function to modify the original variables through_____.
Hint
The function receives locations rather than copies of the values.
Answer
pointers
- 28Declaring a pointer variable alone does not allocate the pointed-to object; it initially contains a_____value.
Hint
The pointer has storage for an address, but no valid destination has been assigned.
Answer
garbage
- 29Writing through an uninitialized pointer can cause a_____fault because the program accesses memory it should not touch.
Hint
This fault indicates an invalid memory access.
Answer
segmentation
- 30Assigning y = x when both are pointers makes y point to the_____memory block as x.
Hint
The address is copied; a new block is not allocated.
Answer
same
- 31Returning the address of a local array from a function is unsafe because the array's stack memory becomes_____after the function returns.
Hint
The memory may be reused by later function calls.
Answer
garbage
- 32A buffer is a chunk of memory used to store data, such as the characters in a_____.
Hint
In C, this is an array of characters ending with a null terminator.
Answer
string
- 33Copying more data into a buffer than it can hold creates a_____overflow.
Hint
The problem is that the data exceeds the buffer's boundary.
Answer
buffer
- 34A program that writes to index 10 of an array allocated for 10 integers performs an invalid write because valid indexes end at_____.
Hint
C arrays use zero-based indexing.
Answer
9
- 35Overwriting a function's saved return address with attacker-controlled data is the basis of a buffer overflow_____.
Hint
It allows an attacker to redirect program execution.
Answer
exploit
- 36The tool used to detect memory leaks and other memory-related errors in C programs is_____.
Hint
It reports invalid reads, invalid writes, and lost allocated blocks.
Answer
Valgrind
- 37In Valgrind's message invalid right of size four, the size refers to the number of bytes in a typical C_____.
Hint
The lecture states that this type commonly occupies four bytes.
Answer
int
- 38The practice of explaining code aloud to an inanimate object to uncover bugs is called_____duck debugging.
Hint
The object is commonly a small bath toy.
Answer
rubber
- 39An array stores elements in a_____chunk of memory.
Hint
The elements are placed directly next to one another.
Answer
contiguous
- 40Growing an array by allocating a larger one and copying all old elements takes linear time, or big O of_____.
Hint
The amount of work grows with the number of elements copied.
Answer
n
- 41A linked list stores each element together with a pointer to the next_____.
Hint
Each individual element in the list is given this structural name.
Answer
node
- 42The pointer in a linked-list node that identifies the following node is conventionally named_____.
Hint
It indicates what comes after the current node.
Answer
next
- 43A linked list is remembered by a pointer to its first node, commonly called_____.
Hint
This name identifies the beginning of the list.
Answer
first
- 44The next pointer of the final node in a linked list should contain_____.
Hint
It indicates that there is no following node.
Answer
NULL
- 45A major advantage of linked lists over fixed-size arrays is that linked lists can grow and shrink_____.
Hint
Their size can change while the program runs.
Answer
dynamically
- 46If sorted order is not required, inserting a new node at the beginning of a linked list can take_____time.
Hint
Only a fixed number of pointer updates are needed.
Answer
constant
- 47Searching a linked list for a sorted insertion point generally takes linear time, or big O of_____.
Hint
The search may need to visit many nodes one by one.
Answer
n
- 48When a pointer refers to a structure, the C operator used to follow the pointer and access a structure field is the_____operator.
Hint
It is written using a hyphen followed by a greater-than sign.
Answer
arrow
- 49When freeing a linked list, a program should save the current node's next pointer before calling_____on the current node.
Hint
The operation releases dynamically allocated memory.
Answer
free
- 50A stack follows the LIFO rule, meaning_____in, first out.
Hint
A newly placed tray is the first one removed.
Answer
last
- 51The operation that adds an item to a stack is conventionally called_____.
Hint
It is like placing another tray on top of a stack.
Answer
push
- 52The operation that removes an item from a stack is conventionally called_____.
Hint
It is like taking the top tray away.
Answer
pop
- 53A queue follows the FIFO rule, meaning_____in, first out.
Hint
The earliest person in line is served first.
Answer
first
- 54The operation that adds an item to a queue is conventionally called_____.
Hint
It places an item at the back of the line.
Answer
enqueue
- 55The operation that removes an item from a queue is conventionally called_____.
Hint
It removes the item at the front of the line.
Answer
dequeue
- 56An array-based stack must track its current_____so it does not exceed its capacity.
Hint
This records how many items are currently stored.
Answer
size
- 57A queue implementation can avoid shifting every remaining element by tracking which item is in_____.
Hint
This identifies the person or item at the beginning of the line.
Answer
front
- 58An application programming interface is abbreviated as_____.
Hint
It describes the operations exposed by an implementation.
Answer
API
- 59In a tree, the topmost node from which the structure is accessed is called the_____.
Hint
It is analogous to the starting point of a family tree.
Answer
root
- 60Nodes at the bottom of a tree that have no children are called_____.
Hint
The term compares the structure to a plant.
Answer
leaves
- 61A tree in which every node has at most two children is called a_____tree.
Hint
The prefix refers to two possible branches.
Answer
binary
- 62A binary tree in which every left descendant is smaller and every right descendant is larger is a binary_____tree.
Hint
The ordering makes efficient lookup possible.
Answer
search
- 63Searching a reasonably balanced binary search tree takes logarithmic time, or big O of_____.
Hint
Each comparison can eliminate roughly half of the remaining tree.
Answer
log n
- 64In a binary search tree, a node's two child pointers are conventionally named_____and right.
Hint
This pointer identifies the smaller subtree.
Answer
left
- 65The left and right pointers of a leaf node contain_____because the leaf has no children.
Hint
The pointers do not refer to any further nodes.
Answer
NULL
- 66A function that calls itself to search smaller subtrees is using_____.
Hint
The function solves a smaller version of the same problem by calling itself.
Answer
recursion
- 67A function that assigns an input to a bucket or index is called a_____function.
Hint
It transforms an item into a location used for storage or lookup.
Answer
hash
- 68When two different inputs produce the same hash value, the situation is called a hash_____.
Hint
Two items have arrived at the same intended location.
Answer
collision
- 69The technique of checking consecutive positions until an empty one is found is called linear_____.
Hint
The algorithm searches through the table one position at a time.
Answer
probing
- 70A hash table that stores a linked list at each bucket uses separate_____to resolve collisions.
Hint
Each bucket becomes the beginning of a chain of entries.
Answer
chaining
- 71A well-designed hash function should distribute entries approximately_____across the available buckets.
Hint
It should avoid concentrating most entries in only a few chains.
Answer
uniformly
- 72A trie stores words by following pointers selected according to each word's individual_____.
Hint
The path for Maxwell begins with M, then A, then the remaining characters.
Answer
letter
- 73In a trie, a special marker at the end of a path indicates that a complete_____ends there.
Hint
The path may also be a prefix of a longer word, so the marker identifies completion.
Answer
word
- 74Looking up a name in a trie takes time proportional to the number of_____in that name.
Hint
The lookup follows one pointer for each character.
Answer
letters
- 75Assuming names have bounded length, a trie provides effectively_____-time lookup.
Hint
Adding more names does not increase the number of steps for a particular bounded-length name.
Answer
constant
- 76The main trade-off of a trie is very fast lookup in exchange for using more_____.
Hint
Each node contains an array of pointers.
Answer
memory

Ask anything
We've read this whole study set, so questions about it get the best answers.