Computer Science

Helpfulness: 0
Set Details Share
created 8 months ago by lugoedwin96
6 views
Computer Science terms, algorithms, data structures, misc topics about cs
show moreless
Page to share:
Embed this setcancel
COPY
code changes based on your size selection
Size:
X
Show:
1

Compile

The source code must be compiled into machine code in order to become and executable program. This compilation process is referred to as compile time.

2

Runtime

A compiled program can be opened and run by a user. When an application is running, it is called runtime.

3

Source Code

Original Code, typically written by a human into the computer.

4

Translation

Converting source code into something a computer can read (i.e. machine code)

5

Dynamic type check

Dynamic typing is when your type checking occurs at runtime. Instead of errors coming up when you compile your code you will get runtime errors if you try performing operations on incompatible types. (Ex. Python)

6

Static type check

Type checking occurs at compile time, you must define a type for your variables inside of your code and any operations you perform on your data would be checked by the compiler. (Ex. Java)

7

Strong type check

When you have strong typing, you will only be allowed operations on the data by direct manipulation of the object of that data type.

8

Weak type check

Weak typing allows you to operate on data without considering its type. Some language do this through pointers. Other languages will convert one of your types to the other before performing the operations.

9

Function Overloading

Function overloading or method overloading is the ability to create multiple functions of the same name with different implementations.

10

Static Method

A static method is part of a class definition, but is not part of the objects it creates. Important: A program can execute a static method without first creating an object! All other methods (those that are not static) exist only when they are part of an object. (Ex. Hailstone.hailstoneSequence(), to call the static method)

11

Mutating

When you change the contents of a mutable value — such as an array or list or StringBuilder object — you're changing references inside that value.

12

Immutable Type

A type whose values can never change once they have been created, you can only re-assign. (Ex. String)

13

StringBuilder

is a mutable object that represents a string of characters. It has methods that change the value of the object:

StringBuilder sb = new StringBuilder("a"); sb.append("b");

14

Immutable references

Variables that are assigned once and never reassigned. To make a reference immutable, declare it with the keyword final:

final int n = 5;

If the Java compiler isn't convinced that your final variable will only be assigned once at runtime, then it will produce a compiler error. So final gives you static checking for immutable references

15

immutable reference to a mutable value

For example: final StringBuilder sb. This means that the StringBuilder value can change, but the sb variable's arrow (reference) can't change: it must always point to the same StringBuilder object.

16

mutable reference to an immutable value

String name. In this case, the value of the s variable can change because it can be re-pointed to a different object.

String name = "edwin";

String nameAndLastName = name + "Lugo";

17

Semantic HTML

Use of HTML markup to reinforce the semantics, or meaning, of the information in webpages and web applications rather than merely to define its presentation or look.

18

What does hsl mean in hsl(0, 0, 0); for color in CSS

Hue, Saturation, Lightness

19

What does @media (max-width: 100px) { /* CSS Rules */ } mean?

Media query returns the content when the device's width is less than or equal to 100px:

20

What does @media (min-height: 350px) { /* CSS Rules */ } mean?

Media query returns the content when the device's height is more than or equal to 350px.

21

What are vw, vh, vmin, and vmax useful for in CSS?

You can use viewport units for responsive typography. Viewport units, like percentages, are relative units, but they are based off different items. Viewport units are relative to the viewport dimensions (width or height) of a device, and percentages are relative to the size of the parent container element.

(Ex: vw: 20vw is 20% of the view port witdth)

22

Three Principles Of Code Review

1. Easy to Understand

2. Free of Bugs

3. Ready for Change

23

Predecessor

Is the right-most element in the left sub-tree.

24

If the tree is a linear tree of n nodes, what's the worse case running time for basic operations for a binary search tree?

O(n)

25

What is a binary search tree?

...

26

What's the height of Red-Black Trees?

O(lgn)

27

Whats the worse case run-time for basic operations for binary search tree with n height?

O(lng)

28

Why can we use a Binary Search Tree as a Dictionary and a Priority Queue?

Because this data structure supports many dynamic set operations including: Search, Minimum, Maximum, Predecessor, Successor, Insert and Delete.

29

Successor

Is the left-most element in the right sub-tree.