Code C Flashcards
character array
a sequence of items that are of the same data type, char
comment
text a programmer adds to code, to be read by humans to better understand the code but ignored by the compiler
<ctype.h>
provides access to the "character type library", which includes predefined commands such as topper() and tolower(). for example toupper('a') converts a lower case to a upper case 'a'
incremental development
the process of writing, compiling , and testing a small amount of code.,then writing , compiling and testing a small amount more. and so on.
syntax error
a error that violate a programming langage rules on how symbols can be combined to create a program. a program generates a message when encounters this type of error
logic error
a error also called a bug , occurs while a program runs. this program would compile with this type of error but would not run as intended
compiler
to support high level languages, programer create these, which are programs that automatically translate high level language program such as c intro excitable programs
computational thinking
the thought process involved in formulating a problem and expressing it solution in such a way that the computer - human or machine can effectively carry out
type casting
explicit converts a value of one type to another type. for example avgscore = (double)test score/4; where the average score had been declared as a double and testscore had been declared as integer
type conversion
a conversion of one data type to another, such as an int to a double. if done by the compiler, this automatically conversion is known as a implicit conversion.
<stdio.h>
a library that allows us to use inputs and outputs
for loop
this loop has three parts at the top; a loop variable initializes a loop expression and a loop variable update
array
an array is an ordered list of items of a given data type under one variable name
increment/decrement operators
operators such as ++ or-- which supports the shorthand notation. for, example i++ is equivalent to i= i+1 or i -- is equivalent to i= i-1
while loop
this is a construct that checks a expression to be true than repeatedly executes a body statement until that expression is false
incrementally
experience programmers develop program incrementally, meaning they create a simple program version and than growing the program little by little into successively more complete versions
do while loop
this program is a construction that firsts executes the loop body statement then checks the loop condition.
string
a programmer can use a array to store a sequence of characters known as a
boolean
refers to a quantity that has only two possible values, true to false
infinite loop
this loop never stops iterating
conditional expression
condition? expresenTrue; exprWhen false
Linear Search
A search algorithm that starts from the beginning of the list, and checks each element one by one until the search key is found or the end of the list is reached.
Binary Search
first checks the list
Sorting
...
Bubble Sort
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order.
Selection Sort
Selection sort is a sorting algorithm that treats the input as two parts, a sorted part and an unsorted part, and repeatedly selects the proper next value to move from the unsorted part to the end of the sorted part.
Insertion Sort
A sorting algorithm that treatsthe input as two parts, a sortedpart and an unsorted part, andrepeatedly inserts the next valuefrom the unsorted part into the correct location in the sorted parts
Quick Sort
QuickSort is a Divide and Conquer algorithm. It picks an element as pivot and partitions the given arrayaround the picked pivot.There are many different versions of quickSort that pick pivot in different way
Merge Sort
Merge Sort is a Divide and Conqueralgorithm. It divides input array in twohalves, calls itself for the two halves and then merges the two sorted halves.The merge() functionis used for merging two halves. The merge(arr, l, m, r) is key process that assumes that arr[l..m] and arr[m+1..r] are sorted and merges the two sorted sub-arrays into one.