100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

CPTS 121 Final Exam

Puntuación
-
Vendido
1
Páginas
8
Grado
A+
Subido en
14-09-2023
Escrito en
2023/2024

Exam of 8 pages for the course CPTS 121 at CPTS 121 (CPTS 121 Final Exam)

Institución
CPTS 121
Grado
CPTS 121









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
CPTS 121
Grado
CPTS 121

Información del documento

Subido en
14 de septiembre de 2023
Número de páginas
8
Escrito en
2023/2024
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

CPTS 121 Final Exam

recursion Answer- The process in which a function calls itself either directly or
indirectly through another function

base case Answer- tells when the recursion has to stop. For example, let us take
factorial function. The base case here is when n=0 or when n=1; and after every
recursive call to fact() function n value reduced by 1 and finally reaches base case.

recursive step Answer- the line that calls the recursive function

recursive function Answer- A function that calls itself

function call stack Answer- (often referred to just as the call stack or the stack) is
responsible for maintaining the local variables and parameters during function
execution.

what is a bit Answer- Bit is derived from binary digit - A binary digit or bit has two
possible values; 0 or 1

nibble Answer- A sequence of 4-bits
One example of a nibble of data is 11112 This is the number 15 in decimal

byte Answer- A sequence of 8-bits
One example of a byte of data is 0100 00012 This is the number 65 in decimal It's
also the ASCII value for 'A'

How can we determine if a number is even or odd without using the mod (%)
operator? Answer- If the least significant bit (lsb) is 1 the number is odd, if its 0 the
number is even

How do we multiply and divide by powers of 2 without using the multiplication (*) and
division (/) operators? Answer- Recall multiplication and division is expensive and
resource intensive
o Shift all bits in a number to the left by 1 to multiply by 2
o Shift all bits in a number to the right by 1 to divide by 2

bitwise negation Answer- ~
0 -> 1 or 1 -> 0, where -> represents "becomes"

bitwise left shift Answer- <<
means shift each bit in the number to the left by two positions and rotate in zeros -
The result is 11002 if only a nibble of memory is available; otherwise it's 1011002

bitwise right shift Answer- >>

, means shift each bit in the number to the right by one position and rotate in zeros -
The result is 01012; note the lsb is lost in the result

bitwise and Answer- &
10102 & 00112; means AND each bit in each corresponding position - The result is
00102

bitwise or Answer- |
10102 | 00112; means OR each bit in each corresponding position - The result is
10112

bitwise xor Answer- ^
10102 ^ 00112; means XOR each bit in each corresponding position - The result is
10012

what is a command line argument Answer-

what is dynamic memory Answer- Memory allocated at runtime from a memory area
called the heap or memory store

Apply malloc ( ) to allocate memory Answer- The name "malloc" stands for memory
allocation. The malloc() function reserves a block of memory of the specified number
of bytes. And, it returns a pointer of void which can be casted into pointers of any
form.

Apply free ( ) to de-allocate memory Answer- The function free() is used to de-
allocate the memory allocated by the functions malloc ( ), calloc ( ), etc, and return it
to heap so that it can be used for other purposes. The argument of the function free (
) is the pointer to the memory which is to be freed.

Apply sizeof ( ) Answer- Recall this returns the number of bytes allocated for a type
or variable
The sizeof operator is the most common operator in C. It is a compile-time unary
operator and used to compute the size of its operand. It returns the size of a
variable. It can be applied to any data type, float type, pointer type variables.

What is an algorithm Answer- An algorithm is a procedure or step-by-step
instruction for solving a problem. They form the foundation of writing a program.

what is a variable Answer- Memory is allocated when a variable is declared
int var = 0;

what is a datatype Answer- the data storage format that a variable can store a data
to perform a specific operation. Data types are used to define a variable before to
use in a program. Size of variable, constant and array are determined by data types.

Integer (int) Answer- It is a data type that can store numeric data of type integer.
Integers are whole numbers, having no fractional component,
$14.49
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
EvaTee Phoenix University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
5027
Miembro desde
4 año
Número de seguidores
3557
Documentos
52500
Última venta
1 día hace
TIGHT DEADLINE? I CAN HELP

Many students don\'t have the time to work on their academic papers due to balancing with other responsibilities, for example, part-time work. I can relate. kindly don\'t hesitate to contact me, my study guides, notes and exams or test banks, are 100% graded

3.9

917 reseñas

5
439
4
160
3
167
2
46
1
105

Documentos populares

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes