Featured Article

Reverse Delete Algorithm for Minimum Spanning Tree

Reverse Delete algorithm is closely related to Kruskal’s algorithm. In Kruskal’s algorithm what we do is : Sort edges by increasing order of their weights. After sorting, we one by one pick edges in increasing order. We include current picked edge if by including this in spanning tree not form any cycle until there are… Read More »

Adding two polynomials using Linked List

Given two polynomial numbers represented by a linked list. Write a function that add these lists means add the coefficients who have same variable powers. Example: Input: 1st number = 5x^2 + 4x^1 + 2x^0 2nd number = 5x^1 + 5x^0 Output: 5x^2 + 9x^1 + 7x^0 Input: 1st number = 5x^3 + 4x^2 +… Read More »

Complex numbers in C++ | Set 2

Complex numbers in C++ | Set-1 The remaining functions with example: log() – It is used to return the log of the complex number. Output: The log of (-1,0) is (0,3.14159) cos() – It computes complex cosine of a complex value z. Mathematical definition of the cosine is cos z = (e^(iz) + e^(-iz))/2 sin()… Read More »

Encapsulation in Java

Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates.Other way to think about encapsulation is, it is a protective shield that prevents the data from being accessed by the code outside this shield. Technically in encapsulation, the variables… Read More »

Basic Operators in Java

Java provides a rich operator environment. We can classify the basic operators in java in following groups: Arithmetic Operators Relational Operators Bitwise Operators Assignment Operators Logical Operators Let us now learn about each of these operators in details. Arithmetic Operators: Arithmetic operators are used to perform arithmetic/mathematical operations on operands. Addition (‘+’) :  Adds two… Read More »