Skip to main content

Posts

Enhancing the Performance of Graph Algorithms — Part 1

Introduction to the Graph Algorithms We use various types of Data Structures according to the need we have. We are going to discuss Graphs and the way of optimizing the graphs as required for our problem definitions. What is a Graph? Graphs are widely used nowadays. They are used in economics, aviation, physics, biology (for DNA analysis), mathematics, and other fields. A graph is a non-linear Data Structure with nodes(vertices) and edges in Computer Science that is used to implement the undirected graph as well as directed graph theories from the domain of graph theory within Mathematics. There are two types of Graphs that are needed to this level. Directed graph undirected graph Graph Algorithms One of the crucial operations that can be performed on graphs is traversing or searching. There are several algorithms that work on the Graphs. Such as 1 — Dijkstra’s shortest path algorithm 2 — Greedy algorithm 3 —Astar algorithm 4 — Depth-First Search algorithm 5 — Breadth-First Search ...

What Will Happen if Her Majesty Queen Elizabeth II Dies?

This Is Exactly Will Happen When Queen Elizabeth II Dies Nothing in life is as certain as death and taxes, so we must accept that Queen Elizabeth II will die at some point. However, as the world’s longest-reigning monarch, she has raised an entire generation who have never gone through life without her. So what will happen after she dies? When a reigning monarch dies, what protocol is followed? Queen Elizabeth II has been alive for the majority of people’s entire lives. Upon the death of her father, the young Elizabeth Alexandra May Windsor became Queen Elizabeth II. She is the longest-reigning British monarch at 94 years old, having ascended to the throne at the age of 25 in 1952. So it’s understandable that it’s difficult to imagine what will happen when she’s no longer with us. Her father died at the young age of 56, but her mother lived to the ripe old age of 101, proving that longevity runs in her family. But death is unafraid, and — as is customary in England — there are meticulo...

Object-Oriented Programming in Java — Abstraction

To reduce complexity, abstraction in Object-Oriented Programming refers to showing only the essential features of an object to the user and hiding the inner details. In other words, the user only needs to know “what an object does?” rather than “how it does?” Example Image by Author The above sketch is a good real-world example of abstraction. A user can only use and connect with the application’s limited functionality and is uninformed of the system architecture or how the application was built up. Typically, users are only involved with an application’s functionality. Nothing at all is hidden from an administrator , who has access to many more features of the application. The administrator can monitor user activity, understand how the application was created, and implement new features by implementing them in the system. In the previous example, the abstraction is implemented to the user but not to the administrator . Image by Author Let’s take a look at another example of abstract...

Object-Oriented Programming in Java — Multiple Inheritance

Multiple Inheritance occurs when a class is derived from more than one base class, i.e. when a class has more than one immediate parent class. For example 1. A Hyundai Elantra IS A Car 2. A Hyundai Elantra IS A Sedan as well A class in Java cannot extend from more than one class. As a result, the question of “ how can we implement multiple inheritances ” arises. Interfaces are the answer to the preceding question. Interfaces can be used to implement multiple inheritances in Java. A class may implement multiple interfaces, and an interface may extend from multiple interfaces. Take the same example mentioned above. That can be implemented using the following. 1. A base class named Car 2. An interface named IsSedan 3. An Elantra class derived from Car and implementing IsSedan The above illustration then becomes, Image by Author Implementation in Java The output is The model of Elantra is: 2019 The manufacturer of Elantra is: Hyundai The variant of Elantra is: Sport The bootspac...

Basic ROS programming on Windows 10 - Publisher and Subscriber nodes

We've seen how to install ROS in Windows 10 in  this article  and how to write the Hello World in this article . Today lets go further and lets write some advanced and very basic programming in ROS, Publisher and Subscriber nodes in Windows 10. A transmitter and a recipient can be compared to the publishers and subscribers used in ROS message communication. The transmitter is called publisher in ROS, and the recipient is called subscriber. This section is intended to establish a simple message file, and to build and run nodes for Publisher and Subscriber. First we have to create a package with dependencies inside the source folder in catkin workspace. To create a new message the 'message generation' package will be required. 'Std msgs' is the standard ROS message package and the client library to use C/C++ in ROS is 'roscpp'. While creating the package, these dependent packages can be included. They can also be added after creating the 'package...

Hello World project in ROS on Windows 10

We've seen how to install ROS in Windows 10 in this article, this is the time to start programming. What is the very first thing we do once we setup a new Programming Language? Hello World !!! Lets see how to write Hello World in ROS on Windows machine. Before going into the programming, make sure you've installed Gedit on your Windows machine. You can get it from here. Also, setup the path for Gedit and restart your machine to ensure the path definition works. First open the ROS terminal and check for the working directory. We have to be in the catkin workspace. If you've already created it, go to that directory. Or else, create it like this. Create a src folder inside catkin_ws. Inside that newly created src folder, lets create a new package in it. The command to create a ROS package is as follows. >catkin_create_pkg [PACKAGE_NAME] [DEPENDENT_PACKAGE_1] ....[DEPENDENT_PACKAGE_N] ‘std_msgs’ and ‘roscpp’ were added as optional dependent packages...