What Is External Sorting?

1 mainSorting is one of the most common things we do in programming. We are given a bunch of numbers and we want to arrange them according to some rule. Let’s say we want to arrange them in ascending order. To sort these numbers, people tend to use a sorting algorithm that takes place entirely within the memory of a computer. The memory we are talking about is the RAM. Here, we take all the numbers and store them in the memory so that we can sort them. This is possible only when the amount of data is small enough to be stored in the memory. What if we have a hundred trillion numbers to be sorted? It’s too big to be stored in the computer’s memory. How do we do it?   Continue reading

What’s The Use Of Function Pointers In C++?

1 mainWhen we talk about C++ programming, functions and pointers are very important. A function is basically a series of steps packaged into a nice unit. A pointer is an object that refers to a value stored in memory. So why not just combine them and create something really useful! Function pointer is exactly what you think it is. A function pointer is a variable that stores the address of a function. We can call this function using the function pointer. But why would we want to do that? This looks like a roundabout way of doing things, right? What’s the purpose of having it in the first place?   Continue reading