Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Data Structure Articles
Found 1,635 articles
Find the Longest Common Substring using Binary search and Rolling Hash
In this article, we will explain the concept of rolling hash and find the longest common substring using binary search and rolling hash. We will also provide a C++ code implementation for the same. Rolling Hash of a String Problem Statement Algorithm to Find the Longest Common Substring C++ Code Implementation Time and Space Complexity Rolling Hash of a String Rolling hash is a cryptographic technique used to calculate the hash value of a string. In this, we ...
Read MoreActivity Selection Problem
Activity Selection Problem The activity selection problem is an example of a greedy algorithm where the maximum number of non-overlapping activities are selected from the given activity set. A person can complete one activity at a time. The activities are given in the form of their starting and completion times. In this article, we have an array of integers that stores the starting and completion time of each activity. Our task is to select the maximum number of non-overlapping activities from the given activity array. Scenario An example of the maximum activity ...
Read Morelargest string formed by choosing words from a given Sentence as per given Pattern
To find the largest string formed by choosing words from a given sentence, a user should know about the lexicographically largest string. A lexicographically largest string is a string, when sorted alphabetically, it would appear at the last if we form all possible strings from the selected words. For example: {lion, zebra, apple} will be lexicographically sorted as {apple, lion, zebra}. In this article, we have been given a string and a pattern. Based on this pattern, we have to find the lexicographically largest string matching the given pattern by choosing words from the sentence using C. Here is an ...
Read MoreJava Program to Implement the Linear Congruential Generator for Pseudo Random Number Generation
In this article, we will implement the linear congruential generator for pseudo random number generation in Java. Pseudo random number generator (PRNG) are mainly used in simulations, cryptography, or mathematical tasks. What is an LCG? A Linear Congruential Generator (LCG) is a technique to generate a sequence of numbers that looks like random numbers but are actually determined. It is one of the reasons to call it a pseudo-random number. The Linear Congruential Generator (LCG) technique generates a random number based on the previous number and uses linear recurrence to generate the sequence of the random number. Mathematical Formula We can ...
Read MoreDifferent Types of Database Users
Database users interact with data to update, read, and modify the given information daily. There are various types of database users and we will learn in detail about them. Database users can be divided into the following types − Naive users / Parametric users Sophisticated users End Users Application Programmer or Specialized users or Back-End Developer System Analyst Database Administrator (DBA) Temporary Users or Casual Users These users can access the database and recover the data using various applications. Let’s have a quick understanding of all the types in detail − End Users/Parametric Users These users access the ...
Read MoreJava Math subtractExact(long x, long y) method
We will discuss the Java Math subtractExact(long x, long y) method in Java and understand its functionalities and working. The subtractExact()is an inbuilt function in the Java Math library. The function returns the difference between the two parameters passed as arguments in the function. The function returns an exception when the returned value overflows the range of values of a particular data type. It is the most commonly used class for mathematical operations is the java.lang.Math class is a part of the Java Standard Library and is included in the java.lang package. Syntax Following is the syntax of the subtractExact() function ...
Read MoreJava Program for Minimum Rotations Required to Get the same String
In this article, we will learn to count the total number of minimum required rotations to get the original string in Java. We can solve the problem by getting the rotations substrings of the original string or concatenating the original string to itself. Problem statement We have given string str of length N. The task is to find the total number of minimum rotations we need to perform to get the original string. Input 1 str = "bcdbcd"; Output 1 3 Explanation − We need to make 3 rotations to get the original string. ...
Read MoreJava program for minimum move to end operations to make all strings equal
In this article, we will learn how to solve a problem where we are given an array of strings, and we need to make all strings equal by rotating them. This can be done by performing left rotations on the strings. We need to count the minimum number of operations required to do this. If it is impossible to make the strings equal, the output should be -1. Problem statement We have given an array containing n strings. All strings are permutations of each other. We need to count the total number of minimum operations required to make all strings ...
Read MoreLongest double string of a Palindrome
A contiguous sequence of characters, consisting of uppercase, lowercase, repetitive, or unique alphanumeric characters, forms a C++ string. Each string has a unique length, which may be either odd or even in nature. Longest Double String of a Palindrome A Palindromic string is a sequence of characters that reads the same from both the beginning and the end. In other words, characters at equivalent positions from the start and end have no difference. These palindromes can either have an even length or an odd length. The odd-length palindrome features a middle character separating the two equivalent halves. In this article, ...
Read MoreWhat are the classification of security attacks in information security?
There are various classification of security attack is as follows − Cryptanalytic attacks These attacks are combination of statistical and algebraic techniques objective at make sure the secret key of a cipher. These technique inspect the numerical properties of the cryptographic algorithms and aims at discovering distinguishers of the output distribution of cryptographic algorithms from the uniform distribution. Non-cryptanalytic attacks Non-cryptanalytic attacks do not exploit the numerical weakness of the cryptographic algorithm. There are three objective of security are confidentiality, integrity and availability can be very much vulnerable by this type of attack. Attacks threatening confidentiality Attacks threatening the confidentiality ...
Read More