What makes the difference between a good programmer and a smart programmer? Obviously, the way how the programmer performs. In this article, we are going to see some tricks which we can use in Python. These can make us look smarter than a good Python Programmer.

Photo by Alex Chumak on Unsplash
  1. Reversing a String

We’ll use the straightforward concepts of string slicing and negative indexing. …


When it comes to Object-Oriented Programming, the best and most suitable example which really comes to mind is Java. Java, developed by Sun Microsystems, is the industry leader in cross-platform programming languages and application software development. Java’s massive fan base and unprecedented popularity can be attributed to the language’s use of a very simple and efficient approach to performing various programming tasks and assisting developers.

Its convenience can be a distraction at times, and extremely knowledgeable Java developers have always aimed a notch higher and attempted to explore the various possibilities that the language provides. …


In our previous article, we discussed setting up MPI in WIndows 10 machine and verified the MPI through the Hello World program in brief.

Photo by Gustas Brazaitis on Unsplash

Let’s dive right into the code from that lesson. The implemented code is given below.

#include "mpi.h"
#include <stdio.h>
int main(int argc, char* argv[])
{
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int size;
MPI_Comm_size(MPI_COMM_WORLD, &size);
// Get the rank of the process
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
// Print the message
printf("Hello World! I am %d of %d\n", rank, size);
// Finalize the MPI environment.
MPI_Finalize();
return 0;
}

The…


The Message Passing Interface (MPI) is a portable and standardized message-passing standard intended to function on parallel computing architectures. The MPI system requires the syntax and semantics of library routines that can be used by a broad variety of users who are writing portable message-passing programs in C, C++, and Fortran. There are many open-source MPI implementations, which have aided in the development of the parallel software industry and the development of portable and scalable large-scale parallel applications.

Photo by Tadas Sar on Unsplash

In this article, we are going to set up MPI in a Windows 10 machine.

  1. Download and install Visual Studio 2019

You…


In this article, we are going to know how to split the String input (a sentence or a paragraph) into words and count each words’ occurrences.

Image by Author

The picture above is our problem definition and let’s see how to do this in Java.


The graphics processing units (GPUs) have more cores than Central processing units (CPUs) and therefore, when it comes to parallel data computing, GPUs perform exceptionally effectively than CPUs even though GPUs possess lower clock speeds and lack so many core management features when compared to CPUs.

What is clock speed?

The speed of the clock is the rate at which the processor can accomplish the processing cycle. It is usually measured in megahertz or gigahertz. One megahertz is equivalent to one million cycles per second, while one gigahertz is equivalent to one billion cycles per second.


Assume you have an array arr[0,1,..n-1] to sort and want to use p number of threads to do so.

For the sake of simplicity, let us assume that the smallest element has a value of 0 and the largest has a value of m. If the smallest is not equal to 0, then the values can be scaled while assigning elements to threads.

Divide your array into p chunks, each with at most floor(m/p) + 1 different element value.

The ith chunk consists of elements arr[j] such that:

(i — 1) * (floor(m/p) + 1) <= arr[j] < i *…


We have already discussed the Counting Sort algorithm and its parallelizability. If you need to know about them you can read them and all the links are provided below.

Recommended:

  1. Sorting Algorithms: A Comprehensive Guide
  2. Counting Sort Algorithm Explained with Examples
  3. Counting Sort Algorithm: Implementation in Java, an analysis of stability, parallelizability, and the Time and Space Complexities

We have discussed that the Counting Sort is parallelizable and the only drawback is we can’t ensure stability after the sorting. …


In this article, we are going to see a simple Mathematical Operation based task that can be done in Arrays.

Recommended: Read about the Arrays in Java and Data Structures before continuing if needed.

Problem: (a[0] * a[1]) -(a[2] * a[3]) +(a[4] * a[5]) …

If there is an odd number of elements, then put the odd remaining number in a pair with 1 as the missing number e.g. -(a[6] * 1). Look at the following picture for more understanding.

Image by Author

So how to implement this? Our main method will look like this. …


We have seen the same problem and its solution using a long step using Array Data Structure in this article. We are going to solve the same problem in a simplified way using the ArrayList Data Structure.

Recommended: Read about the Arrays in Java and Data Structures before continuing if needed.

Image by Author

As we discussed in our previous article, let’s solve the same problem but using the ArrayList Data Structure.

int [] array = {1, 1, 2, 3, 3, 4, 1, 3};
removeDuplicates(array);

This is our original array. And we are calling the method removeDuplicates and passing the original array as…

Nickson Joram

Reading Bachelor of Science Honours in Computer Science at University of Jaffna, HND in Construction and Built Environment (Civil Engineering)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store