Arnab Chakraborty has Published 4282 Articles

Finding Quadrant of a Coordinate with respect to a Circle in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 07:26:16

281 Views

We have one circle (center coordinate and radius), we have to find the quadrant of another given point (x, y) lies with respect to the center of the circle, if this is present in the circle, print quadrant, otherwise print error as the point is present outside.Suppose the center of ... Read More

Find Simple Closed Path for a given set of points in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 07:21:48

368 Views

Consider we have a set of points. We have to find a simple closed path covering all points. Suppose the points are like below, and the next image is making a closed path on those points.To get the path, we have to follow these steps −Find the bottom left point ... Read More

Find minimum and maximum elements in singly Circular Linked List in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 07:14:25

535 Views

Here we will see how to get the minimum and maximum value from one singly circular linked linear list. The basic concept is very simple. The next part of the last node will be pointed to the first node, the first node will also be pointed using start pointer. When ... Read More

Find K Closest Points to the Origin in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 07:05:18

375 Views

Suppose we have a set of points. Our task is to find K points which are closest to the origin. Suppose the points are (3, 3), (5, -1) and (-2, 4). Then the closest two (K = 2) points are (3, 3), (-2, 4).To solve this problem, we will sort ... Read More

Minimize Cash Flow among a given set of friends who have borrowed money from each other in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 06:59:30

1K+ Views

Suppose there are few friends. They have borrowed money from each other. So there will be some cash flow on the network. Our task is to minimize the cash flow in the network. Suppose there are three friends P1, P2, and P3. The cash flow among them is like below ... Read More

Check if a number is Palindrome in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 06:53:53

764 Views

Here we will see, how to check whether a number is a palindrome or not. The palindrome numbers are the same in both directions. For example, a number 12321 is a palindrome, but 12345 is not a palindrome.The logic is very straight forward. We have to reverse the number, and ... Read More

Check if a point is inside, outside or on the parabola in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 06:45:39

393 Views

Suppose, one parabola is given (the vertex coordinate (h, k) and distance from focus and vertex is a), another point is also given. We have to find whether the point is inside the parabola or not. To solve it, we have to solve the following equation for the given point ... Read More

Check if a point is inside, outside or on the ellipse in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 06:42:15

806 Views

Suppose, one ellipse is given (the center coordinate (h, k) and semi-major axis a, and semi-minor axis b), another point is also given. We have to find whether the point is inside the ellipse or not. To solve it, we have to solve the following equation for the given point ... Read More

Check if a number is power of k using base changing methods in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 06:39:10

245 Views

Here we will see a program, if one number is given, another value k is also given, we have to check whether the number is power of k or not. But we have to perform the base changing method to solve this problem. Suppose a number is 27, and k ... Read More

Check if a number is power of 8 or not in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 22-Oct-2019 06:32:41

531 Views

In this section, we will see, if a number is the power of 8 or not using some easier method. If a number like 4096 is there, then the program will return true, as this is the power of 8.The trick is simple. we will calculate log8(num). If this is ... Read More

Advertisements