Computer Science Basics

Computers

Computers are used for solving real time problems, compared to humans they are not intelligent ,they cannot think on thier own (well ! time will change things...computers please don't get offended till then 😃),still computers are having huge impact on humans is because of their potential to solve any bigger problem with simple operations,which humans otherwise give up in the mid way due to monotonous and time consuming process in solving.

Unlike humans they don't have girl friends or family or friends. Their focus and power is truly dedicated in solving problems. and they are trust worthy because they don't have any prejudice or predetermination.

Computer Programs are used for solving problems, they are written in Programming languages such as C,C++,Java,Javascript and Python etc., a program is written in a specific format with specic vacobulary as per the language design, this special piece of information is called computer code or simply code. A computer code that we write is human readable, it's called as High Level Language( C,C++,Java,Javascript and Python etc). Computer can't understand high level language( it understards only 1(on) and 0(off), they are called bits) , so it needs Compiler.

Compiler is used to convert a High level language code into machine readable low level language code(Binary Code). Low level meaning, An english character 'A'(Ascii character 65) is stored in a computer as '0100 0001'(65 in binary form) bits. Computer understands binary digits(0,1). like human deals in decimal digit(0,1,2,3,4,5,6,7,8,9).

Binay Code is a series of Binary digits 0(voltage off) and 1(voltage on). Real world objects like numbers, characters, audio and videos etc are converted and stored into computer in binary digits based on standards such as ASCII and Unicode for character encoding , multi-media encoding for audios and videos. Which when retrieved decoded by computer to understand the object.

Any Idea can be implemented using computers, before we solve it using computer understandable language, there are ways to create modals on paper to make sure the solution is what we intended.

These Modals helps in writing an Algorithm.

Modalling Ideas

There are different way to organize the logic/process to solve an issue

Take an example of a simple well known problem, finding maximum number out of given 3 numbers

Flow Charts

flow charts are simple mechanism to organize the process of problem solving.

Pseudocode

Pseudocode is a false/dummy code, which is writing a program step by step which will be understood by humans only,this is helpful in checking the correctness of logic before implementing it in a computer program. Like doing a planning before implementing.

For the same problem mentioned above , a sample code looks something like below

function maximum(A=10,B=12,C=5) IF A>B -- 10>12 which is false , control goes to else IF A>C -- 10>5 return A ELSE return C END ELSE --controll comes here IF B<C --12<5 which false, control goes to else return C ELSE return B -- 12 is the max number out of all END END

Algorithims

An Algorithm is a step by step procedure to solve a problem. Most of the problems in the computing world are done in many different ways, Choosing the Best solution in terms of the time it takes to give us results and the space it takes to sit on the computer hard drive is taken into consideration.
Time Complexity is the time a program/process takes to give us the results i.e. the number of operations that program required to finish. Space Complexity is the space a program/process required in a computer to run the program.

Best Algorithm/Solution to a problem is often considered to have lesser Time and Space Complexity. Thanks to Advancements in Semi conductor industry, now large space(Memory) can be accommadated in small area, giving us the freedom to use more space. An algorithm with Less Time complexity is considered more Efficient than the one with less Space complexity.

Comments

Popular posts from this blog

Java Script Array Methods

Javascript Date Methods