Data Structure Articles

Page 2 of 164

PHP Program for Converting Roman Numerals to Decimal Lying Between 1 to 3999

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 314 Views

Roman numerals are characters used in a numeric notation system based on the ancient Roman system. In this tutorial, we'll convert Roman numeral strings to decimal values in the range 1 to 3999. Roman Numeral System Roman numerals follow descending order but use subtractive notation to avoid four consecutive characters. Here are the main symbols − SYMBOL VALUE M 1000 CM 900 D 500 CD 400 C 100 XC 90 L 50 XL 40 X 10 ...

Read More

PHP Program to Check if all rows of a matrix are circular rotations of each other

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 203 Views

A rectangular array called a matrix is made up of rows and columns. And circular rotations entail rotating the array's elements so that after one rotation, the last member is in the first position and the other elements are shifted to the right. We are given an N*N matrix in this problem, and our objective is to determine whether all of the rows are circular rotations of one another. If they are, print "YES, " otherwise print "NO." In order to better understand the issue, let's look at some cases with explanations below. Input 1 mat ...

Read More

Multilevel Indexes

Mithlesh Upadhyay
Mithlesh Upadhyay
Updated on 14-Mar-2026 18K+ Views

In RDBMS, indexes are data structures that speed up data retrieval by reducing disk accesses. As databases grow, single-level indexes become too large for main memory. Multilevel indexes solve this by dividing the index into a hierarchy of smaller, manageable blocks. Index Components Search Key Sorted primary/candidate key points to Data Reference Pointer to disk ...

Read More

Difference between Inverted Index and Forward Index

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 2K+ Views

Inverted Index and Forward Index are data structures used to search text within a document or a collection of documents. They differ in how they map the relationship between words and documents − one indexes by word, the other by document. Forward Index A forward index stores the document name as the key and maps it to the list of words contained in that document. It answers the question: "What words does this document contain?" Inverted Index An inverted index stores each word as the key and maps it to the list of documents that contain ...

Read More

Difference between Linear and Non-linear Data Structures

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 21K+ Views

Data structures are classified into linear and non-linear based on how their elements are arranged and connected. Understanding this distinction is fundamental to choosing the right data structure for a given problem. Linear Data Structures A linear data structure has data elements arranged in a sequential manner where each element is connected to its previous and next element. This sequential connection allows traversal in a single run. Linear data structures are easy to implement because computer memory is also organized sequentially. Examples include Array, List, Queue, and Stack. Non-linear Data Structures A non-linear data structure has ...

Read More

Add and Search Word - Data structure design in C++

Arnab Chakraborty
Arnab Chakraborty
Updated on 11-Mar-2026 541 Views

Suppose we have to design a data structure that supports the following two operations −addWord(word)search(word)The search(word) method can search a literal word or a regular expression string containing only letters a-z or .. A . means it can represent any one letter. So for example, if we add some words like “bad”, “dad”, “mad”, then search for search(“pad”) → false, search(“bad”) → true, search(“.ad”) → true and search(“b..”) → trueTo solve this, we will follow these steps −There are some methods, initially define insertNode(), this will take the head reference and the string s, this will work as follows −curr ...

Read More

Find the Longest Common Substring using Binary search and Rolling Hash

Farhan Muhamed
Farhan Muhamed
Updated on 06-Aug-2025 559 Views

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 More

Activity Selection Problem

Ravi Ranjan
Ravi Ranjan
Updated on 21-Jul-2025 9K+ Views

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 More

Java Program to Implement the Linear Congruential Generator for Pseudo Random Number Generation

Alshifa Hasnain
Alshifa Hasnain
Updated on 29-Mar-2025 673 Views

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 More

Different Types of Database Users

Tapas Kumar Ghosh
Tapas Kumar Ghosh
Updated on 14-Feb-2025 40K+ Views

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 More
Showing 11–20 of 1,635 articles
« Prev 1 2 3 4 5 164 Next »
Advertisements