Shared Flashcard Set

Details

CS 225 Exam 0
UIUC CS 225 - FA 2018
18
Computer Science
Undergraduate 2
09/08/2018

Additional Computer Science Flashcards

 


 

Cards

Term
Direct Proof
Definition
showing the truth or falsehood of a given statement by a straightforward combination of established facts
Term
Induction steps
Definition
Claim: P(n) is true for all positive integers n.

Proof: We’ll use induction on n.

Base: We need to show that P(1) is true.

Induction: Suppose that P(n) is true for n = 1, 2, . . . , k−1. We
need to show that P(k) is true.
Term
Reflexive relation
Definition
Every element is related to itself
Term
Irreflexive relation
Definition
No element is related to itself
Term
Symmetric relation
Definition
a is related to b if b is related to a.

for all x, y ∈ A, xRy implies yRx

Ex:

if 3 -> 4 then 4 -> 3 (related backwards/forwards)
Term
Transitive relation
Definition
if aRb and bRc, then aRc
Term
A function is equivalent if
Definition
type signature and output are the same.
Term
Onto functions
Definition
∀y ∈ B, ∃x ∈ A, f(x) = y
Term
One-to one function
Definition
∀x, y ∈ A, x != y → f(x) != f(y)
Term
Every variable is defined by 4 properties
Definition
Type, Name, value, memory location
Term
Encapsulation
Definition
Separates methods from methods, represented as a pill and as .h/.cpp files in c++
Term
Things to include and where in c++ files
Definition
#pragma once - top of .h file
#include "Cube.h" - top of .cpp file
Term
Large libraries in C++ are organized into
Definition
namespace
Term
Constructors in C++, defined where?
Definition
Top of public h file, defined as Cube.h for example.
Term
Indirection operators
Definition
&c -> returns the memory address of c's data
Term
*v
Definition
returns the data at that memory address
Term
What should we never do with stack memory?
Definition
Return a pointer to the stack variable
Term
Equivalence relation
Definition
All 3: Reflexive, symmetric, transitive.
Supporting users have an ad free experience!