Median of Two Sorted Arrays

karthikeya Boyini
Updated on 16-Jun-2020 09:23:44

771 Views

Medians are the middle numbers, in other words, the median value is the middle observation in an ordered list. It corresponds to the cumulative percentage of 50%.The size of two arrays must be same, we will find the median of two separate arrays at first, then compare the separate medians to get an actual median of two lists.Input and OutputInput: Two sorted array are given. Array 1: {1, 2, 3, 6, 7} Array 2: {4, 6, 8, 10, 11} Output: The median from two array. Here the median value is 6. Merge the given lists into one. {1, 2, 3, ... Read More

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

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

Split String at Particular Character in JavaScript

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

228 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

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

327 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

116 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)

Difference Between Static Classes and Non-Static Inner Classes in Java

seetha
Updated on 16-Jun-2020 09:10:13

937 Views

Following are the notable differences between inner classes and static inner classes.Accessing the members of the outer classThe static inner class can access the static members of the outer class directly. But, to access the instance members of the outer class you need to instantiate the outer class.Examplepublic class Outer {    int num = 234;    static int data = 300;    public static class Inner{       public static void main(String args[]){          Outer obj = new Outer();          System.out.println(obj.num);          System.out.println(data);       }    } ... Read More

Bootstrap 4 btn-outline-success Button Class

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

324 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

Remove Top Border from Element in Bootstrap 4

Amit Diwan
Updated on 16-Jun-2020 09:06:59

2K+ Views

Use the border-top-0 class to remove the top border from an element.Set the class as if we add any other class to an element −   Top border is missing Above, I have taken as our element. Another class “mystyle” is also added that styles our div −.mystyle {   width: 350px;   height: 170px;   margin: 10px; }You can try to run the following code to work with the border-top-0 class in Bootstrap 4 −ExampleLive Demo       Bootstrap Example                             .mystyle {       width: 350px;       height: 170px;       margin: 10px;     }         Rectangle   Top border is missing

Advertisements