×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner
Ashutosh Singh

Ashutosh Singh

Intern at OpenGenus | Pursuing B. Tech in Computer Science at Indian Institute of Information Technology (IIIT) Sricity

Ghazipur, Uttar Pradesh, India •
7 posts •
Algorithms

Longest common substring using rolling hash approach

We can solve the longest common substring problem using the rolling hash technique in O(N * log(N)^2) time and O(N) space which is significantly better than other approaches.

Ashutosh Singh Ashutosh Singh
Algorithms

Longest Common Subsequence

In this problem, we solved the Longest Common Subsequence problem using Dynamic Programming which takes O(N*M) time while a brute force approach takes O(2^N) time

Ashutosh Singh Ashutosh Singh
Algorithms

Longest Common Substring in two strings

In this problem, we explored a Dynamic Programming approach to find the longest common substring in two strings which is solved in O(N*M) time. Brute force takes O(N^2 * M) time.

Ashutosh Singh Ashutosh Singh
Algorithms

Find if a string is a sub-string of another string

We have presented two approaches to check whether a string is a substring of another string namely naive method which takes O(N^2) time and efficient method using the concept of Rolling Hash which takes linear time O(N).

Ashutosh Singh Ashutosh Singh
Algorithms

Rolling Hash

Rolling hash is an algorithmic technique which is used to prevent rehashing the whole string while calculating hash values of the substrings of a given string

Ashutosh Singh Ashutosh Singh
Algorithms

Longest repeating and non overlapping substring in a string

We have to find the longest repeating and non-overlapping substring in a given string. Brute force approach takes O(N^3) time while Dynamic Programming takes O(N^2) time.

Ashutosh Singh Ashutosh Singh
Algorithms

Check if a number is an Armstrong Number

An Armstrong number is an integer such that the sum of the digits raised to the power of the number of digits is equal to the number itself. We verify it in O(logN * loglogN) time.

Ashutosh Singh Ashutosh Singh
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship