A week ago, we saw how to overload an assignment operator in object oriented paradigm. As a whole, operator overloading is an important and challenging task. Bjarne Stroustrup, the author and designer of C++ took considerable pain to ensure that user defined types become as close to the built in types as possible. Operator overloading is an offshoot of this. It saves time, energy, resources and many potential dangers to the program. There are certain rules and conventions while overloading operators. Some of them are described in this article.
In the previous post I elaborated on Quick Sort and its basic principles, recursive technique, how to select the pivot and the comparison of quick sort and bubble sort. Today I shall explain a sample problem step by step and then write a source code for it. As I mentioned, I would be considering the first element of the list as the pivot. Watch for the next paragraphs for step by step procedure and source code.
We left our series of Sorting Algorithms about two months ago. Till then we discussed many in-place sorting algorithms like insertion sort, bubble sort, selection sort and gnome sort. These all were the basic algorithms which were inefficient for sorting large lists. For large amount of data, very advanced sorting algorithms have been developed by the experts and a lot of research is still going on in this area. According to many, the fastest Sorting Algorithm in Computer Science is the Quick Sort Algorithm. I shall explain this brilliant algorithm to you in this article in detail. Afterwards we would together write a source code for that.
As we have already learnt, file handling in c++ is a very strong and important tool to assist us with our work. File handling can save us a lot of trouble and can save us some really good amount of time. File Input methods and advantages have been previously discussed, now we start over on data output and how to save information in a separate file for later use.
In our last post on inputting information from file, we discussed how to open a file and read from it to input useful information. This information saves a lot of load and helps in quick and easy input of a lot of data instantly into the system for processing. In this post, we’ll show you how to take advanced input; input different data types simultaneously from the file that could help even more in the data processing.