reading-notes

Readings: Topic

Pain and Suffering

In short, you must distinguish between pain and suffering, you must tell yourself that the pain is good that motivates you to grow, to be better, remember why you are exposed to this pain, what is the benefit, and remember that the pain is fleeting and the benefit remains, but suffering is aimless, go away About everything that makes you suffer

A beginner’s guide to Big O Notation

Big O

Big O notation is used in Computer Science to describe the performance or complexity of an algorithm.

Big O common orders of growth:

1- O(1) : describes an algorithm that will always execute in the same time

2- O(N) : grow linearly and in direct proportion to the size of the input data set

3- O(N²) : represents an algorithm whose performance is directly proportional to the square of the size of the input data set.

4- O(2^N) : growth doubles with each addition to the input data set

Logarithms

Programmers use logarithms to shorten the computer programming process.

Binary logarithms can be used to calculate the length of the representation of a number in the binary numeral system.

Names and Values in Python

In Python, we say that names refer to values, or a name is a reference to a value:

x = 23

Many names can refer to one value:

x = 23
y = x

Names are reassigned independently

x = 23
y = x
x = 12

Assignment never copies data

nums = [1, 2, 3]
other = nums

For loops

for x in sequence:
    something(x)