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
-
Economics & Finance
Data Structure Articles
Page 2 of 164
PHP Program for Converting Roman Numerals to Decimal Lying Between 1 to 3999
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 MorePHP Program to Check if all rows of a matrix are circular rotations of each other
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 MoreMultilevel Indexes
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 MoreDifference between Inverted Index and Forward Index
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 MoreDifference between Linear and Non-linear Data Structures
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 MoreAdd and Search Word - Data structure design in C++
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 MoreFind 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 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 More