Java Program to find the longest repeating sequence in a string8 Jan 2025 | 2 min read In this program, we need to find the substring which has been repeated in the original string more than once.
In the above string, the substring bdf is the longest sequence which has been repeated twice. The algorithm of the program is given below. Algorithmmain()
lcp(String s, String t)
Program:Output: Longest repeating sequence: bdf Next TopicJava Programs |
In this section, we will learn what is tech number and how can we find tech numbers through a Java program. Tech Number A number is called a tech number if the given number has an even number of digits and the number can be divided exactly into...
3 min read
In this program, we need to check whether given matrices are equal or not. Two matrices are said to be equal if and only if they satisfy the following conditions: Both the matrices should have the same number of rows and columns. Both the matrices should have the...
5 min read
Java Program to find the frequency of odd & even numbers in the given matrix In this program, we need to find the frequencies of odd and even numbers present in the matrix. In the above example, all odd numbers are represented by the blue square and...
3 min read
It is a very interesting problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going...
7 min read
In this program, we need to create a binary search tree, delete a node from the tree, and display the nodes of the tree by traversing the tree using in-order traversal. In in-order traversal, for a given node, first, we traverse the left child then...
11 min read
Java Convert double to int We can convert double to int in java using typecasting. To convert double data type into int, we need to perform typecasting. Typecasting in java is performed through typecast operator (datatype). Here, we are going to learn how to convert double primitive type into...
1 min read
It is a problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, HCL, IBM, and Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are...
10 min read
A binary tree is given whose edges are undirected and whose nodes are connected. Also, the tree is not cyclic. The binary tree is made up of t nodes that are numbered from 0 to t - 1 and have exactly t - 1 edge. Every...
21 min read
It is a problem frequently asked in interviews of top IT companies like Google, Amazon, TCS, Accenture, etc. By solving the problem, one wants to check the logical ability, critical thinking, and problem-solving skill of the interviewee. So, in this section, we are going to discuss...
5 min read
In this program, we will create a circular linked list and remove duplicate nodes from the list. We will compare a node with rest of the list and check for the duplicate. If the duplicate is found, delete the duplicate node from the list. 1->2->2->4->3 In the...
2 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India