# Ajantha College and School Students Science Projects materials

"In the name of Allah, most
Gracious, most Compassionate"

Phone

044 4213 1795

Mobile

+91 91764 16648

## Archive for the ‘C plus plus’ ’ Category

#### Control structures and statements in C and C++

Control structures form the basic entities of a “structured programming language“. We all know languages like C/C++ or Java are all structured programming languages. Control structures are used to alter the flow of execution of the program. Why do we need to alter the program flow ? The reason is “decision making“! In life, we may be given with a set of option like doing “Electronics” or “Computer science”. We do make a decision by analyzing certain conditions (like our personal interest, scope of job opportunities etc). With the decision we make, we alter the flow of our life’s direction….

#### Quick Sorting algorithm with example code in C/C++/Java languages

We have seen 3 simple sorting algorithms already 1) Bubble Sorting 2) Selection Sorting and finally Insertion sorting. All these algorithms were so simple to understand and were easy to implement as a program in C/C++ or even Java. But at the same time all 3 of them were too inefficient. Their execution time was of the order of n*n, where n is the number of elements to be sorted. In practice, these simple sorting algorithms are seldom used. Quick sort is an improved sorting algorithm developed by Tony Hoare (C.A.R Hoare) in 1960, at the age of 26, while…

#### Insertion sorting algorithm with example in C/C++/Java languages

So far we have seen 2 sorting algorithms:- 1) Bubble sorting and 2) Selection sorting. Now in this article, we are analyzing insertion sort algorithm with its example code suitable for C/C++/Java programming languages. I recommend you go through above articles of Bubble sorting and Selection sorting before reading further. Insertion sorting algorithm sorts one element at a time. It begins by sorting the first 2 elements in order. In the next step, it takes the third element and compares it against the first two sorted elements. Exchanges are made if necessary and the 3 elements will be sorted with respect to…

#### Selection Sort in C/C++/Java programming languages

In the previous article, we have analysed Bubble sort algorithm and it’s implementation in C programs. In this article we are going to see another sorting algorithm, named, Selection sorting. Just like “Bubble sort”, selection sort is also considered as an inefficient sorting algorithm. If you are curious to know the reason for this, please read the article about Bubble sort carefully. The number of comparisons involved in an average bubble sort is 0.5*(n*n-n). Same is the index for Selection sort too. Note:- Since the algorithm is implemented with the help of 2 FOR loops only, it can be used…

#### Difference between Procedure Oriented(POP) and Object Oriented Programming(OOP)

We all know there exist 2 approaches to write a program – 1) Procedure oriented programming (POP) and 2) Object oriented programming (OOP). You can write a program in either way but there are notable differences between both approaches. These 2 approaches are the result of software development evolution over many decades. Since the invention of computer, many approaches and methods have been tried to write a program. It includes methods like a) Top-Down programming b) Bottom-Up programming c) Modular programming d) Structured programming etc. The basic purpose or the basic aim of all these methods were same – “to…