Sunday, December 16, 2018

Searching and Sorting

Hi i will share the notes i obtain from my lecture







Sorting can be done 2 ways, ascending or descending.

I learnt 5 ways of sorting :
- bubble sort
- selection sort
- insertion sort
- quick sort
- merge sort

Bubble,selection and insertion all took a lot of time to do that is because they compare every single array element with the other.

while quick and merge sort are faster and they use recursive function to do them.

Searching is an action to retrieve information based on particular key from saved information

Key is used to differentiate between one data and the other, Key must be unique so there is no duplicate key inside a data.

Several searching methods are : Linear, Binary, Interpolation
- Linear search : compares each element inside an array with the key
- Binary search : find data using its binary, but the data needs to be sorted first
- Interpolation data : also works on sorted array, searching technique is done with the approximate location of data.

File Processing

Hi I want to share notes i get from my lecture


C sees files as stream, what is stream? Stream is a sequence of character, all input and output data is stream.

There are 2 types of file, text file and binary files.
- Text file is saved in text format or ASCII FILE
- Binary file is saved by storing numerical data in affixed format

Buffer area :  a part of a memory used as a temporary space before data is moved to a file.

if file is opened with fopen it will need to be closed with fclose

you can either read,write or append data from a file in C.
- read = store file in c
- write = to place a new data in the file
- append = to update new data to the file

Recursion and Function

Hi so today I will tell you what i,ve learned from my class.

The programming method i am learning now is modular programming, which divides a problem to a smaller set of problem to make it easier to solve.

Modular programming major benefit is to make it easier for us to know if there are some mistakes in our program and easier for us to fix the problem.

Function : a set of programming statements which are gathered because they do the same action

There are 2 types of function : library function and user defined function
-library function : function that is provided by C compiler
-user defined function : self defined function by the author

You can use function by passing parameter to the function from your main module.

Variable to be used by the functions can be either local or global variable.

Global variable : variable that can be used by every function.
Local variable : variable that can only be used by a certain function

Wednesday, November 28, 2018

Cloud Computing Services

Hi so I just got a new homework which involves updating my blog so here we go.

What is cloud computing services?
- Cloud computing services is simply said, cloud computing is the delivery of computing services servers, storage, databases, networking, software, analytics, intelligence and more over the Internet (“the cloud”) to offer faster innovation, flexible resources and economies of scale. You typically pay only for cloud services you use, helping lower your operating costs.

Cloud Computing ideas :
-Separate IT infrastructure from main system, managed separately by one party, accesible anywhere via internet and may be shared.
-Decrease the risk of having third party application for a particular business, so the company can be more focused towards their business.
-Efficiency of infrastructure in almost every way possible.

What are its advantages and disadvantages?
       Advantages :
       - Lower compute resources cost
       - Flexible performance improvement
       - Reduce software / hardware cost
       - Managable infrastructure update
       - Relieve storage capacity limitation
       - Increase data reliability
       - Universal data access
       - Easier group collaboration
       - Device independence

      Disadvantages :
       - Requires a constant internet connection
       - Features might be limited
       - Performance/speed concerns
       - Lost of Data and System errors
       - Data Security concern
       - Doesn't work with low speed internet connections

There are 3 services given by the cloud computing service which is :
- Infrastructure as a service (IaaS) :
Lowest level of cloud based computing service, an IaaS will deliver pre-installed and configured hardware/software through a virtualized interface, examples of IaaS is web hosting company such as : GOOGLE, IBM, Amazon, etc.

 - Platform as a service (PaaS) :
Similar to IaaS but PaaS provider offers a computing platform and solution stack as a service, which means that it may come with a graphic user interface, run-time system library, programming language or an OS(operating system), PaaS services are mostly used by companies that need to develop a particular application, examples of PaaS provider is Google App Engine, Microsoft Azure, etc

- Software as a service (SaaS)
When talking about cloud services, most people think of SaaS providers, because they provide fully functionally web based applications on demand to customers. The application are mainly targeted at business users and can include web conferencing, email, time management, etc. Examples of SaaS providers are Citrix, Netsuite, etc.


Deployment Examples:
- Social networking : Facebook, Instagram, Linkedin, etc
- Data Sharing :Email, Dropbox, Google Drive, etc
- Education : Quipper, Smart Campus, E-learning, E-library,etc
- Business / Office application : Online shop portal, Google doc, Personal/Corporate website, etc
- HPC for limited duration : Efficiency for massive computing workload, etc



Wednesday, October 17, 2018

Array and Pointer Notes

Hi, My name is alfred and i'm going to show u my notes about array and pointers using c language

1. Pointer : variable that stores another variable's address.
Syntax : <type> *(pointer name);

2. Pointer can also store another pointer's address, it is called multi pointer, you just need to add more star.
Syntax : <type>**ptr_name;

3. Pointer will update the value of the integer/pointer if the integer/pointer is updated.

4. Array : same data type that is saved in certain slots/address but can be retrieved in any/random order.
Syntax : <type> Array_name[value_dimensional];

5. Array can be single dimensional or multi dimensional.
Syntax for 2D array : <type> Array_name[row][column];
Syntax for 3D array : <type> Array_name[row][column][depth];

6. Pointers can be combined with array.
Syntax : <type> *Array_name[single_dim];

7.String vs Char : Char is only a single variable stored in an array, while strings is an array of character that ended with '\0' or null.

8. Strings can be accessed with %s, char can be accessed with %c.

Wednesday, October 10, 2018

Repetition Notes

Hi, My name is alfred and i'm going to show u my notes about repetition using c language

1. There are 3 types of looping :For, While, Do-While
2. Syntax for repetition : FOR
    ex: for(con1;con2;con3) statement;
        - con1 = initialisation
        - con2 = condition for stopping
        - con3 = increment(+1) or decrement (-1)

 *single statement looping*
        or

  ex: for(con1;con2;con3) {
        statement1;
        statement2;
        }

*the example above is how to use for to repeat 2 or more statements*

3. In for there are 2 types of loop, which is :
        - Infinite loop : Loop with no condition, it will loop forever and will stop by using "break;".
        - Nested loop : Loop in Loop, the repetition will begin from the loop inside first.

4. While vs Do-While : The difference between while and do-while is that while will check the condition first, if it fits then it'll start to loop, meanwhile do-while will start the loop first and check the statement at the end.

5. Syntax in While : while(con1) statement;
        -con1 is usually the counter for the loop
        -statement is the thing that gets repeated

*single statement looping*

    or

  ex: while(con1) {
        statement1;
        statement2;
        }

*the example above is how to use for to repeat 2 or more statements*

 6. Syntax in Do-While : do{
                                        statement;
                                        }while(con1);

*"do" will keep looping until con1 is wrong*
*works for multi statements as well*

7. If the statement is wrong, "while" will not repeat it at all, but "do-while" will repeat it at least once

8. Break vs Continue
- Break will stop the loop or case in "switch-case"
- Continue will skip the statements inside a loop or skip to the next loop





Alfred.S
Binus.ac.id
2201731913