This lecture note is about Expressing and Analyzing Algorithms.

Please refer to the first lecture note below :

2022.09.08 - [CS Knowledge] - [UPenn] Computational Thinking for Problem Solving

Source: Penn Engineering

 

Linear Search and Binary Search

This work is making a bunch of comparisons, called 'Linear Search' with linear complexity, which cannot be the most efficient way to bring the outcome.

In linear search, we start with the first item and look at the next one, whereas in 'Binary Search', we start comparing the value in the middle of the list to the target, and if they are equal, then we have found the target and can stop looking. If the value in the middle of the list is greater than the target, remove the middle element and elements that are larger than it and repeat. If the value in the middle of the list is less than the target, remove the middle element and elements that are smaller than it and repeat. By using this method, we can save more time and spend fewer comparisons to get to the target. (Penn Engineering)

It is somehow better than the linear search. However, the binary search has logarithmic complexity, meaning that if we double the input size, the number of operations only increases by one.

There are two different algorithms.

 

Brute Force Algorithms

Brute force algorithms can be used for solving optimization problems.
• Try all possible solutions
• Identify the ones that solve the problem
• Determine the best one

 

Greedy Algorithms

Do the thing that seems best at the time
• Brute force: consider all possible solutions and choose the best one. It is optimized but cannot be the quickest.
• Greedy: make a decision that seems best right now and keep repeating
it until done. It is quick but cannot be optimized.

 

Source: Penn Engineering

 

The difference between Greedy and Brute force is whether to look through every possible solution or not. Each algorithm has pros and cons, so it is essential to use each in a good situation.

Moreover, depending on the case, all types of algorithms can be used in one flowchart.

'CS Knowledge' 카테고리의 다른 글

[UPenn] Computational Thinking for Problem Solving  (0) 2022.09.08
Fetch! Decode! Execute!  (0) 2022.09.07
Network: IP address and DNS  (0) 2022.09.05

Learning Computer Science and Coding after many years of working in the Social Science and Language field makes me feel that I need to think differently when studying coding. Thus, I chose to take this course, which was very intriguing from the beginning since I can apply this way of thinking not only when I work on Coding but also in so many ways, from relatively small decisions in daily life to problem-solving situations in other fields. I am very much excited to take this course to expand my way of thinking and enhance my design of Algorithms.

Source: Penn Engineering

 

Decomposition
• Breaking a complex problem into more manageable sub-problems.
• Putting the solutions to the subproblems together gives a solution to the original, complex problem.

Pattern Recognition
Finding similarities or shared characteristics within or between problems.
• Makes the problem easier to solve since the same solution can be used for each occurrence of the pattern.

Data Representation & Abstraction
Determining what characteristics of the problem are important and filtering out those that are not.
• Use these to create a representation of what we are
trying to solve.

Algorithms
Step-by-step instructions on how to solve a problem.
• Identifies what is to be done (the instructions) and the order in which they should be done.

 

I learned from this lecture that a computational way of thinking is not only for a coding or IT-related field of studies or work but for any situation, studies, or work in our life. That is cool, isn't it?

 

You can also start this course on Coursera right now!

https://www.coursera.org/learn/computational-thinking-problem-solving

 

Computational Thinking for Problem Solving

Offered by 펜실베이니아 대학교. Computational thinking is the process of approaching a problem in a systematic manner and creating and expressing a ... 무료로 등록하십시오.

www.coursera.org

 

'CS Knowledge' 카테고리의 다른 글

[UPenn] Expressing and Analyzing Algorithms  (0) 2022.09.12
Fetch! Decode! Execute!  (0) 2022.09.07
Network: IP address and DNS  (0) 2022.09.05

Currently, I am studying in a coding school selected as one of the government scholarship students. During the course, I learned a lot by studying consistently! It is a very challenging time, but I am more energized every time by having more curiosity and solving the questions. 

 

Recently, I became more interested in Computer Science knowledge since coding is related to writing efficient lines and computational thinking and having CS-related knowledge to utilize. I will keep updating if I find cool videos or information to share:)

 

In this post, I am introducing a video about "How computer works." 

https://youtu.be/Z5JC9Ve1sfI

Source: Tom Scott Youtube video

It is a beneficial video for me as a beginner in the Computer Science field. I could easily understand how the CPU works just by THREE WORDS: Fetch! Decode! and Execute!

 

Also, have you heard of the language "Assembly"?

It is a low-level programming language that is very different from what we learn nowadays. Personally thinking, it is a very complicating language since it looks farther from a human language.

https://en.wikipedia.org/wiki/Assembly_language

 

Assembly language - Wikipedia

From Wikipedia, the free encyclopedia Jump to navigation Jump to search Low-level programming language In computer programming, assembly language (or assembler language,[1] or symbolic machine code[2][3][4]), often referred to simply as Assembly and common

en.wikipedia.org

The old game "Prince of Persia" was made by the language called "Assembly," I can't even imagine how hard that was and how rewarding it was when the programmer completed it.

Source:  https://www.vintageisthenewold.com/port-of-prince-of-persia-on-atari-xl-xe-first-playable-level-released

 

'CS Knowledge' 카테고리의 다른 글

[UPenn] Expressing and Analyzing Algorithms  (0) 2022.09.12
[UPenn] Computational Thinking for Problem Solving  (0) 2022.09.08
Network: IP address and DNS  (0) 2022.09.05

The IP address was first designed in the 1970s when the population of Earth was 4 billion, so there are about 4.2 billion IP addresses that can be made. The number of people now is over 7 billion, which IPv4 lacks to distribute all the addresses to everyone on Earth. As an alternative, there has been IPv6 that has 16 bits in each octet instead of 8. Moreover, It can make an almost infinite number of IP addresses, so now, we don't have to worry.

To see your IP address, you could enter 'ipconfig' on Command Prompt.

Ip address is designated based on your location. It has xxx.xxx.xxx.xxx format, and each 'xxx' is called "Octet" since each octet is filled with 8 bits(in total 32 bits.).

The IP address consists of numbers that are very hard to remember. We would instead remember 'Domain Names', which are easier to remember because they are in 'Human languages'. This system is called 'DNS(Domain Name System)'. If you want to know the IP address of a particular domain, you will use the keyword of 'ping' on the Command Prompt.

To inspect, the system sends 4 packets to the website to see if the server works well. Some servers block people from seeing their IP addresses. Moreover, we can just copy the IP address and paste it into the address bar to enter the same website.

To connect server and client, you need to know 1)the IP address of the server and 2)the number of the port. Following is a table of relatively well-known port numbers.

Port No. Description
21 ftp(File Transfer Protocol)
22 ssh(Secure Socket Shell)
23 telnet(Teletype Network Protocol)
80 http(Hypertext Transfer Protocol) : Usually omitted.
25 smtp(Simple Mail Transfer Port)
110 pop3(Post Office Protocol 3)

'CS Knowledge' 카테고리의 다른 글

[UPenn] Expressing and Analyzing Algorithms  (0) 2022.09.12
[UPenn] Computational Thinking for Problem Solving  (0) 2022.09.08
Fetch! Decode! Execute!  (0) 2022.09.07

+ Recent posts