To show flex items vertically on different screen sizes, use the flex-*- column class. For small, medium and large screen sizes, use it as −For Small screen size −For Medium screen size −For Large screen size −Let us see an example to learn how to set flex items vertically on different screen sizes −ExampleLive Demo Bootstrap Example Example Note: Change the browser size to see the effect. Default One Two Three Flex on differet screen size (Medium) One Two Three Flex on differet screen size (Large) One Two Three
If you want to set content as a Bootstrap modal, then use the .modal(options) method.On button click, the modal generates as in the following script.$(document).ready(function(){ $("#button1").click(function(){ $("#newModal1").modal({backdrop: true}); }); });Above, I have set options as “backdrop:true”. Another option, we can set is “backdrop: true” −backdrop: true = Clicking outside the modal, close it.backdrop: false = Clicking outside the modal, won’t close it.You can try to run the following code to implement the modal(“options”) class −ExampleLive Demo Bootstrap Example ... Read More
The .modal(“hide”) method hides the modal on button click.Firstly, generate the modal and display it −$("#newModal").modal("show");After that, use the modal(“hide”) method on a button to hide the modal on button click −$("#button1").click(function(){ $("#newModal").modal("hide"); });Let us see an example of the modal(‘hide”) method wherein we are hiding a modal which generates on page load −ExampleLive Demo Bootstrap Example #button1 { width: 140px; padding: 20px; bottom: 150px; ... Read More
Align single rows of items at the baseline in Bootstrap 4, use the .align-items-baseline class.To align at the baseline:
To find the longest palindromic substring from a string, we can use Manacher’s Algorithm. By selecting each character, we will try to find if there any palindrome using left and right pointer. There is another array to store information, from that information we can easily find how long the palindrome is. For each character, the array will store information. After traversing the whole string, we can find the longest palindromic subsequence from the created array.The time complexity of this algorithm is O(n).Input and OutputInput: String: “levelup” Output: Longest palindrome is: levelAlgorithmlongestPalindrome(text)Input − The text to find the longest palindromeOutput − ... Read More
Use the .align-content-*-stretch in Bootstrap 4 to stretch gathered items on different screens.To stretch items on different screens −Stretch items on Small Screen Work 1 Work 2 Work 3 Work 4 Work 5 Work 6 Stretch items on Medium Screen Work 1 Work 2 Work 3 Work 4 Work 5 Work 6 Stretch items on Large Screen Work 1 Work 2 Work 3 Work 4 Work 5 Work 6 Let us see an example to stretch gathered items on different screen size ... Read More
Naïve pattern searching is the simplest method among other pattern searching algorithms. It checks for all character of the main string to the pattern. This algorithm is helpful for smaller texts. It does not need any pre-processing phases. We can find substring by checking once for the string. It also does not occupy extra space to perform the operation.The time complexity of Naïve Pattern Search method is O(m*n). The m is the size of pattern and n is the size of the main string.Input and OutputInput: Main String: “ABAAABCDBBABCDDEBCABC”, pattern: “ABC” Output: Pattern found at position: 4 Pattern found at ... Read More
The hide.bs.modal event in Bootstrap fires when the modal is about to be hidden.The following button hides the modal − Click to hide Just after clicking the hide button, the hide.bs.modal event fires and before the modal is hidden. Here is the script for the hide.bs.modal event:$("#newModal").on('hide.bs.modal', function () { alert('The modal is about to be hidden.'); });The following is the complete example to implement the hide.bs.modal event in Bootstrap −ExampleLive Demo Bootstrap Example ... Read More
In Bootstrap 4, if you want a flex item to take up the available space, then use the flex-grow-|1 class.If you want the first flex item to take up the space, then the following is the code − One Two Three Above you can see, I have used the flex-grow-1 class in the first div class − One The following is an example to implement the flex-grow-0|1 class −ExampleLive Demo Bootstrap Example
Anagrams are basically all permutations of a given string or pattern. This pattern searching algorithm is slightly different. In this case, not only the exact pattern is searched, it searches all possible arrangements of the given pattern in the text.To solve this problem, we will divide the whole texts into several windows of length same as patterns. Then count on each character of the pattern is found and stored in an array. For each window, we also try to find the count array, then check whether they are matching or not.The time Complexity of Anagram Pattern Search Algorithm is O(n).Input ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP