compting 10c midterm 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/48

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:37 PM on 4/21/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

49 Terms

1
New cards

cd Documents

go into documents

2
New cards

ls

list files

3
New cards

mkdir Projects

create folder

4
New cards

cd Projects

go into folder

5
New cards

pwd

print current path

6
New cards

touch file.txt

create file

7
New cards

cp file.txt backup.txt

copy file

8
New cards

cp

creates new file copy/copies files (needs -r)

9
New cards

cp without -r

error, directories require recursive flag

10
New cards

touch

creates new empty file

11
New cards
g++ compiler
Compiles C++ source code into an executable
12
New cards
-O3 flag
Highest level of compiler optimization
13
New cards
-c flag in g++
Compiles source file into object file without linking
14
New cards
Linking
Combines object files into final executable
15
New cards
Compilation vs Linking
Compilation checks syntax; linking resolves function definitions
16
New cards
Undefined reference error
Happens during linking when a function is declared but not defined
17
New cards
argc
Argument count (number of command-line arguments)
18
New cards
argv
Array of command-line arguments
19
New cards
argv[0]
Name of the program
20
New cards
argv[1]
First user-provided argument
21
New cards
Check for valid arguments
if (argc != expected) return error
22
New cards
ofstream
Writes output to a file
23
New cards
ifstream
Reads input from a file
24
New cards
Opening a file
Check if stream is valid using if (!stream)
25
New cards
Writing to file
out << data
26
New cards
Closing file
out.close()
27
New cards
fs::path
Object representing a filesystem path
28
New cards
Creating fs::path
Can be constructed from a string or string literal
29
New cards
directory_iterator
Used to iterate through files in a directory
30
New cards
entry.path()
Returns the path of a directory entry
31
New cards
chmod +x
Makes a file executable
32
New cards
Permission denied error
Happens when file lacks execute permission
33
New cards
man command
Displays manual documentation for a command
34
New cards
Dynamic Programming (DP)
Method for solving problems by storing subproblem results
35
New cards
LCS (Longest Common Subsequence)
Longest sequence appearing in both strings in order
36
New cards
LCS table size
N x M (lengths of two strings)
37
New cards
LCS time complexity
O(NM)
38
New cards
LCS recurrence
If characters match: dp[i][j] = dp[i-1][j-1] + 1; else max of top or left
39
New cards
LCS backtracking
Start from bottom-right and trace back to build sequence
40
New cards
LCS result length
Value in bottom-right of DP table
41
New cards
Partial LCS recomputation
If one row changes, only recompute that row → O(M)
42
New cards
Makefile
Automates compilation process
43
New cards
Object file (.o)
Intermediate compiled file before linking
44
New cards
Makefile target
A rule that defines how to build something
45
New cards
Makefile dependency
Files required to build a target
46
New cards
Pattern rule %.o : %.cpp
Compiles any .cpp file into .o file
47
New cards
Clean target
Removes compiled files (e.g., rm -f *.o executable)
48
New cards
tellg()
Returns current read position in file
49
New cards
read() function
Reads a specific number of bytes into a buffer