Biconnected Graph

Samual Sam
Updated on 16-Jun-2020 09:20:10

4K+ 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 connected, and there are no articulation points or cut vertex are present in the graph.To solve this problem, we will use the DFS traversal. Using DFS, we will try to find if there is any articulation point is present or not. We also check whether all vertices are visited by ... Read More

What are method local inner classes in Java?

Prabhas
Updated on 16-Jun-2020 09:18:52

2K+ Views

In Java, we can write a class within a method and this will be a local type. Like local variables, the scope of the inner class is restricted to the method.A method-local inner class can be instantiated only within the method where the inner class is defined. The following program shows how to use a method-local inner class.ExampleLive Demopublic class OuterClass {    public void display(){       int num = 23;       class Inner{          public void print() {             System.out.println("This is method inner class "+num);     ... Read More

How do I split a string, breaking at a particular character in JavaScript?

Anvi Jain
Updated on 16-Jun-2020 09:18:37

254 Views

To split a string on every occurrence of ~, split the array. After splitting, add a line break i.e. for each occurrence of ~.For example, This is demo text 1!~This is demo text 2!~~This is demo text 3!After the split and adding line breaks like the following for ~ occurrence −This is demo text 1! This is demo text 2! This is demo text 3!ExampleLet’s see the complete exampleLive Demo        Adding line break           var myArray = 'This is demo text 1!~This is demo text 2!~           ... Read More

What is the (function() { } )() construct in JavaScript?

Rishi Rathor
Updated on 16-Jun-2020 09:15:21

2K+ Views

The (function() { } )() construct is an immediately invoked function expression (IIFE). It is a function, which executes on creation.SyntaxHere’s the syntax −(function() {    // code })();As you can see above, the following pair of parentheses converts the code inside the parentheses into an expression −function(){...}In addition, the next pair, i.e. the second pair of parentheses continues the operation. It calls the function, which resulted from the expression above.

tooltip("show") method in Bootstrap

Alex Onsman
Updated on 16-Jun-2020 09:13:04

360 Views

Use the tooltip(“show”) method in Bootstrap to display the tooltip. As shown below that the tooltip is visible on button click:$(document).ready(function(){   $(".btn-primary").click(function(){     $("[data-toggle='tooltip']").tooltip('show');   }); });The tooltip would be visible on a link wherein I have set the data-toggle attribute and the link text as shown in the following code snippet −   On clicking the below button, the tooltip would be visible. You can try to run the following code to implement the tooltip(“show”) method −ExampleLive Demo       Bootstrap Example                 ... Read More

Set less important stuff with grey outlined Bootstrap 4 Button

Alex Onsman
Updated on 16-Jun-2020 09:10:44

133 Views

To set less important stuff in Bootstrap, use the btn-outline-secondary class.The outline is applied on a button and a green color is applied using the same class −   Tools (Secondary Outline) Above, I have set the btn-outline-secondary class as any normal class set on any element, which is button here.You can try to run the following code to learn how to set grey outline Bootstrap Button −ExampleLive Demo       Bootstrap Example                         Web Tools   The following are the Tools:       JSON Editor     XML Editor     For more, click below:   Tools (Secondary Outline)

Bootstrap 4 .btn-outline-success Button class

Alex Onsman
Updated on 16-Jun-2020 09:09:03

360 Views

Use the btn-outline-success class in Bootstrap to set green outline to a button.Green button outline states success and you can set a button like this −   Result Above I have set the class on element just like we set a class on any other element in HTML or Bootstrap.Here is an example to learn how to work with the btn-outline-success class in Bootstrap −ExampleLive Demo       Bootstrap Example                         Result   The following are the subjects:       Maths     Digital Electronics     For result, click below:   Result

How to convert an array to string in java?

Nikitha N
Updated on 16-Jun-2020 09:05:47

862 Views

The Arrays class of the java.util package provides toString() methods for all primitive data types and object. These methods accept an array and return its string representation.Therefore, to convert an array to string pass the required array to this method.ExampleLive Demoimport java.util.Arrays; public class ArrayToString {    public static void main(String args[]) throws Exception {       int[] myArray = {23, 93, 56, 92, 39};       String str = Arrays.toString(myArray);       System.out.println(str);    } }Output[23, 93, 56, 92, 39]

What are all the ways an object can be created in Java?

varun
Updated on 16-Jun-2020 09:03:59

240 Views

You can create an objectUsing new keyword.Sample obj = new Sample();Using the newInstance() method and Class.forName() method.Sample obj2 = (Sample) Class.forName("Sample").newInstance();Using the clone() method by implementing Cloneable Interface (marker).Sample obj3 = (Sample) obj1.clone();Using class loader.Object obj4 = Sample.class.getClassLoader().loadClass("Sample");Using the constructor class from lang.reflect.Class cls = Sample.class; Constructor obj = cls.getDeclaredConstructors()[0]; Sample obj5 = (Sample) obj.newInstance();

How to create an array of linked lists in java?

Abhinanda Shri
Updated on 16-Jun-2020 09:02:50

5K+ Views

A linked list is a sequence of data structures, which are connected together via links.To create an array of linked lists, create required linked lists and, create an array of objects with them.ExampleLive Demoimport java.util.LinkedList; public class ArrayOfLinkedList {    public static void main(String args[]) {       LinkedList list1 = new LinkedList();       list1.add("JavaFX");       list1.add("Hbase");             LinkedList list2 = new LinkedList();       list2.add("OpenCV");       list2.add("Mahout");             LinkedList list3 = new LinkedList();       list3.add("WebGL");       list3.add("CoffeeScript");       Object[] obj = {list1, list2, list3};             for (int i=0; i

Advertisements