The Basics of Programming and Software Flashcards

programming, algos, data struct, engineering

You may prefer our related Brainscape-certified flashcards:
1
Q

what is machine language / machine code

A

computer hardware can only understand raw binary instructions of electronic signals.

no signal = 0 or false

a signal = 1 or true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a compiler?

A

a program that transforms high-level programming language (Java, C, C++, C#) written by a programmer, into machine level language ( 1s and 0s) so the CPU/hardware can understand and execute the program.

The main job of the compiler is that it checks all kinds of limits, ranges, errors, etc. Before the compiler can successfully execute the code, the errors must be removed from the source code.

The output of compiler is a mnemonic version of machine code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is an assembler?

A

a program that converts the assembly code (text-based) into machine code (binary).

The output of assembler is binary code.

The translation is mechanical, and can be done in only one way. Meaning that given an assembly code 𝐴, there is a single translation 𝑇(𝐴) of 𝐴 into machine code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a code fix called a patch?

A

old computers used punch paper tape full of holes and they fixed the program by putting tape over holes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is an assembly language?

A

a low-level text-based language which uses mnemonics/opscode to represent each machine binary code.

it has direct 1:1 mapping to machine instructions. And has to deal with fetching data from specific memory address, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

where did the term loop come from in programming

A

Old computers had their programs written on punch paper tape full of holes.

To make the computer repeat the program, they used tape to tape the two ends of the punch paper together and it formed a loop of paper tape.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

why were high-level programs created?

A

it was painful for humans to write programs in binary (1s and 0s) which only CPU hardware can understand.

And assembly language / machine code often only works on specific computers, not all types of computers.

So they built high-level programming languages so it was easier and faster for humans to write programs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

why was assembly language created?

A

people got sick of writing programs in 1s and 0s / binary / machine code.

LOAD_A is easier to understand, write and read for humans than 00101110.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why was COBOL created?

A

Because early FORTRAN programs at the time could only run on a specific type of computer. So programs had to be rewritten when new computer hardware was created.

COBOL programming language was created to be used strictly for business and made to be portable so it can be run on different types of computers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does COBOL stand for?

A

common business-oriented language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the limits of assembly language / machine code?

A

it’s CPU specific. So progs written in it, often only worked on a specific computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is the selection sort algorithm?

A

an algorithm for sorting values in an array.

n^2

  1. it looks at each item in the array and finds the smallest number
  2. It moves the smallest number to the top.
  3. Repeats those operations on the rest of the numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Big O Notation

A

A theoretical measure of the execution of an algorithm, usually the time or memory needed, given the problem size n, which is usually the number of items.

Used to determine how slow a sorting algo exponentially grows as the number of items that need to be sorted increases.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is the merge sort algorithm?

A

an algorithm for sorting values in an array.

n*log n

  1. splits the array into arrays of 1 item in each
  2. compares 2 arrays to find the smallest value
  3. merges the 2 arrays into 1 sorted array
  4. repeats for the rest of the paired arrays.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what dijkstra’s algorithm? And what is it used for?

A

An algorithm for finding the shortest paths between nodes in a graph.

It assigns a number value to nodes and the routes between them and calculates the shortest path.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is a queue data structure?

A

a way of determining the order of operations for data or instructions.

first in first out (FIFO)

The item first put in the queue is the first one taken out and processed.

Like a line of people waiting at the coffee shop. The one who’s been waiting the longest, gets served first.

17
Q

what is a stack data structure?

A

a way of determining the order of operations for data or instructions.

last in first out (LIFO)

The item put in the stack last is the first one taken out and processed. data is pushed onto the stack and popped off of it.

Like when you get a stack of pancakes. The last pancake (the one at the top) is eaten first.

18
Q

List 3 common data structures

A

queue

stack

trees

19
Q

what is the difference between a compiler and assembler?

A

A Compiler is more intelligent than an Assembler.

Compiler converts the source code written by the programmer into machine code. And outputs a mnemonic version of machine code.

Assembler converts the assembly language code into the machine code. And outputs binary code.

20
Q

List examples of compiled languages.

A

C, C++, Java, and C#