- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Samual Sam has Published 2492 Articles
Samual Sam
373 Views
The inversions of an array indicate; how many changes are required to convert the array into its sorted form. When an array is already sorted, it needs 0 inversions, and in another case, the number of inversions will be maximum, if the array is reversed.To solve this problem, we will ... Read More
Samual Sam
3K+ Views
An undirected graph is said to be a biconnected graph, if there are two vertex-disjoint paths between any two vertices are present. In other words, we can say that there is a cycle between any two vertices.We can say that a graph G is a bi-connected graph if it is ... Read More
Samual Sam
360 Views
You can read the contents of a file using the Scanner class and You can find the comments in a particular line using contains() method.Exampleimport java.io.*; import java.util.Scanner; public class FindingComments { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(new File("HelloWorld")); ... Read More
Samual Sam
4 Views
To find whether the browser supports JavaScript or not, use the tag. The HTML tag is used to handle the browsers, which do recognize tag but do not support scripting. This tag is used to display an alternate text message.ExampleLive Demo ... Read More
Samual Sam
4K+ Views
There are n different activities are given with their starting time and ending time. Select the maximum number of activities to solve by a single person. We will use the greedy approach to find the next activity whose finish time is minimum among rest activities, and the start time is ... Read More
Samual Sam
134 Views
Adding an element to an array can be done using different functions for different positions.Adding an element at the end of the arrayThis can be accomplished using the push method. For example, let veggies = ["Onion", "Raddish"]; veggies.push("Cabbage"); console.log(veggies);This will give the output −["Onion", "Raddish", "Cabbage"]You can also use this ... Read More
Samual Sam
5K+ Views
Dijkstra's algorithm is an algorithm for finding the shortest paths between nodes in a weighted graph. We'll use the new addEdge and addDirectedEdge methods to add weights to the edges when creating a graph. Let us look at how this algorithm works −Create a distance collection and set all vertices ... Read More
Samual Sam
451 Views
A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted (un)directed graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. That is, it is a spanning tree whose sum of edge ... Read More
Samual Sam
1K+ Views
Kruskal's algorithm is a greedy algorithm that works as follows −1. It Creates a set of all edges in the graph.2. While the above set is not empty and not all vertices are covered, It removes the minimum weight edge from this setIt checks if this edge is forming a ... Read More
Samual Sam
1K+ Views
document.onloadIt gets fired prior to loading of images and other external content. document.onload event is fired before the window.onload.window.onloadIt gets fired when the complete page loads, which includes images, scripts, css, etc.ExampleHere’a an example to understand onload.Live Demo JavaScript Animation ... Read More