1/46
Vocabulary practice flashcards covering Arrays, Strings, Recursion, Enums, Structures, Unions, File Handling, Searching, and Sorting based on Programming for Problem Solving Mid-II course material.
Array
A collection of elements of the same data type stored in contiguous memory locations, referred to by a single name, and accessed using an index starting from 0.
One-Dimensional (1-D) Array
A linear list of elements of the same data type accessed using a single subscript (e.g., a[i]).
Two-Dimensional (2-D) Array
A collection of data elements organized into rows and columns (matrix or table) stored in row-major order and accessed using two subscripts (e.g., a[i][j]).
Row-Major Order
The memory storage arrangement for two-dimensional arrays in C where elements are stored contiguously row by row.
Matrix Multiplication Condition
The mathematical requirement that the number of columns of the first matrix must equal the number of rows of the second matrix (c1=r2) for multiplication to be possible.
Matrix Addition Condition
The rule stating that two matrices can only be added if they share the exact same order (identical numbers of rows and columns).
String (in C)
A sequence of characters stored in a char array and terminated by the null character '\0', requiring an array size of at least length +1.
Null Character ('\0')
The character constant with an ASCII value of 0 used to mark the end or termination of a string in C.
strlen()
A library function in
strcpy()
A library function in
strncpy()
A library function in
strcat()
A library function in
strcmp()
A library function in
strncmp()
A library function in
strchr()
A string-handling library function in
strstr()
A string-handling library function in
Substring
A portion of a main string taken from a specified starting index position for a specified length.
Recursion
A programming technique in which a function calls itself directly or indirectly to solve a problem by dividing it into smaller sub-problems of the same type.
Base Case
The stopping condition in a recursive function that is solved directly without further recursive calls, preventing infinite recursion.
Recursive Case
The branch of a recursive function in which the function invokes itself with modified parameters to progress toward the base case.
Calling Phase (in Recursion)
The initial phase of recursion where each consecutive function call pushes a new activation record (containing parameters, local variables, and return address) onto the call stack.
Returning Phase (in Recursion)
The second phase of recursion, initiated after reaching the base case, where stacked calls are popped one by one in LIFO order and each returns its value to its caller.
Stack Overflow
A runtime failure that happens when a recursive function lacks a proper base case or fails to reach it, resulting in endless calls that exhaust stack memory.
Factorial (Recursive Formula)
The mathematical product of integers from 1 to n defined recursively as n!=n×(n−1)!, with base cases 0!=1 and 1!=1.
Fibonacci Series
A sequence of numbers where each term is the sum of the preceding two terms, defined recursively by fib(n)=fib(n−1)+fib(n−2) with fib(0)=0 and fib(1)=1.
Enumerated Data Type (enum)
A user-defined data type in C consisting of a set of named integer constants, where the first identifier defaults to 0 and each subsequent one increments by 1 unless explicitly assigned.
Structure (struct)
A user-defined data type in C that groups variables of different data types under a single name, where each member is assigned its own separate memory.
Dot (.) Operator
The member access operator in C used to access individual members of a structure or union variable (e.g., variable.member).
Nested Structure
A structure that contains another structure variable as one of its internal members, accessed using chained dot operators (e.g., s.dob.day).
Array of Structures
An array in which every element is an individual structure variable of the same type, typically used to store collections of records.
Union
A user-defined data type in C where all members share the same single memory location, the allocated size equals the largest member, and only one member can store a valid value at a time.
File Pointer (FILE *)
A pointer variable of type FILE declared in
fopen()
A C file-handling function with syntax fopen("filename", "mode") that opens a file and returns a FILE pointer, or NULL if the operation fails.
File Mode "r"
A file-opening mode that opens an existing text file for reading only, setting the file pointer at the beginning; returns NULL if the file does not exist.
File Mode "w"
A file-opening mode for writing only that creates a new text file if it does not exist, or truncates (erases) existing contents if the file already exists.
File Mode "a"
A file-opening mode for appending that creates a new file if nonexistent, or adds new data exclusively to the end of the file without erasing existing contents.
fprintf()
A file-handling function that writes formatted data into an opened file according to format specifiers, analogous to printf().
fscanf()
A file-handling function that reads formatted input from an opened file into specified variable addresses, returning the number of items successfully read or EOF on failure.
fputc()
A file-handling function with syntax int fputc(int ch, FILE *fp) that writes a single character to a file.
fgetc()
A file-handling function with syntax int fgetc(FILE *fp) that reads a single character from a file and returns EOF when reaching the end of the file.
fwrite()
A binary file-handling function used to write contiguous blocks of data (such as records, structs, or arrays) directly into a file.
fread()
A binary file-handling function used to read contiguous blocks of data from a file directly into memory.
Linear Search
A sequential searching algorithm that checks every array element one by one from start to end until the key is found or the list ends; works on unsorted data with O(n) worst-case complexity.
Binary Search
A divide-and-conquer search algorithm for sorted arrays that compares the target key to the middle element, repeatedly discarding half the remaining search space with O(log(n)) worst-case complexity.
Bubble Sort
A sorting algorithm that repeatedly compares adjacent elements and swaps them if they are in the wrong order, causing the largest unsorted element to bubble up to the end each pass.
Selection Sort
A sorting algorithm that repeatedly selects the minimum element from the unsorted sub-array and places it at the beginning, executing at most n−1 swaps with O(n2) time complexity.
Insertion Sort
A sorting algorithm that sequentially takes each element from the unsorted portion and shifts larger elements in the sorted portion to insert it into its correct position.