Courses
Tutorials
Practice
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
DSA
22.8K+ articles
JavaScript
12.2K+ articles
HTML
5.8K+ articles
CSS
4.9K+ articles
JQuery
4.9K+ articles
PHP
3.9K+ articles
ReactJS
3.6K+ articles
Node.js
3.5K+ articles
jQuery-jQWidgets
2.5K+ articles
PHP-function
2.3K+ articles
Web Technologies
/
PHP
/
PHP Programs
PHP Programs
2.3K+ posts
Recent Articles
Popular Articles
PHP Program to Check if it is possible to sort the array after rotating it
Last Updated: 23 July 2024
Given an array of size N, the task is to determine whether its possible to sort the array or not by just one shuffle. In one shuffle, we can shift some contiguous elements...
read more
Greedy
Sorting
Competitive Programming
Web Technologies
PHP
PHP Programs
DSA
rotation
PHP Program for Check if an array is sorted and rotated
Last Updated: 22 July 2024
Given an array of N distinct integers. The task is to write a program to check if this array is sorted and rotated counter-clockwise. A sorted array is not considered as s...
read more
Web Technologies
PHP
PHP Programs
DSA
Arrays
rotation
PHP Program for Reversal algorithm for right rotation of an array
Last Updated: 22 July 2024
Given an array, right rotate it by k elements. After K=3 rotation Examples: Input: arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} k = 3Output: 8 9 10 1 2...
read more
Web Technologies
PHP
PHP Programs
DSA
Arrays
rotation
PHP Program to Find element at given index after a number of rotations
Last Updated: 23 July 2024
An array consisting of N integers is given. There are several Right Circular Rotations of range[L..R] that we perform. After performing these rotations, we need to find an...
read more
Web Technologies
PHP
PHP Programs
DSA
Arrays
array-range-queries
rotation
PHP Program for Minimum rotations required to get the same string
Last Updated: 22 July 2024
Given a string, we need to find the minimum number of rotations required to get the same string. Examples:Input : s = "geeks"Output : 5Input : s = "aaaa"Output : 1Algorith...
read more
Strings
Web Technologies
PHP
PHP Programs
DSA
rotation
PHP Program to Inplace rotate square matrix by 90 degrees | Set 1
Last Updated: 23 July 2024
Given a square matrix, turn it by 90 degrees in an anti-clockwise direction without using any extra space.Examples :Input:Matrix: 1 2 3 4 5 6 7 8 9Output: 3 6 9 2...
read more
Matrix
Web Technologies
PHP
PHP Programs
DSA
Arrays
Microsoft
Amazon
Google
Morgan Stanley
Facebook
Zoho
rotation
PHP Program to Find the Size of Subarray With Maximum Sum
Last Updated: 22 July 2024
Given an Array, the task is to find the size of the subarray that yields the maximum sum. This article provides a comprehensive guide on how to implement a PHP program to ...
read more
Dynamic Programming
Web Technologies
PHP
PHP Programs
DSA
Arrays
subarray
subarray-sum
PHP Program to Find a triplet such that sum of two equals to third element
Last Updated: 23 July 2024
Given an array of integers, you have to find three numbers such that the sum of two elements equals the third element.Examples:Input: {5, 32, 1, 7, 10, 50, 19, 21, 2}Outpu...
read more
Searching
Web Technologies
PHP
PHP Programs
DSA
Arrays
Amazon
Arcesium
two-pointer-algorithm
PHP Program for Pairs such that one is a power multiple of other
Last Updated: 23 July 2024
You are given an array A[] of n-elements and a positive integer k (k 1). Now you have find the number of pairs Ai, Aj such that Ai = Aj*(kx) where x is an integer.Note: (...
read more
Searching
Sorting
Web Technologies
PHP
PHP Programs
DSA
Arrays
PHP Program to Find closest number in array
Last Updated: 22 July 2024
Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers.Examples:Input : arr[] = ...
read more
Divide and Conquer
Searching
Web Technologies
PHP
PHP Programs
DSA
Arrays
Binary Search
PHP Program for Number of pairs with maximum sum
Last Updated: 23 July 2024
Write a PHP program for a given array arr[], count the number of pairs arr[i], arr[j] such that arr[i] + arr[j] is maximum and i j.Example:Input : arr[] = {1, 1, 1, 2, 2,...
read more
Searching
Web Technologies
PHP
PHP Programs
DSA
Arrays
PHP Program to Find maximum element of each row in a matrix
Last Updated: 22 July 2024
Given a matrix, the task is to find the maximum element of each row.Examples:Input : [1, 2, 3] [1, 4, 9] [76, 34, 21]Output :3976Input : [1, 2, 3,...
read more
Searching
Matrix
Technical Scripter
Web Technologies
PHP
PHP Programs
DSA
PHP Program to Interchange elements of first and last rows in matrix
Last Updated: 22 July 2024
Given a 4 x 4 matrix, we have to interchange the elements of first and last row and show the resulting matrix.Examples :Input : 3 4 5 0 2 6 1 2 2 7 1 2 ...
read more
Matrix
School Programming
Web Technologies
PHP
PHP Programs
DSA
PHP Program for Diagonally Dominant Matrix
Last Updated: 22 July 2024
In mathematics, a square matrix is said to be diagonally dominant if for every row of the matrix, the magnitude of the diagonal entry in a row is larger than or equal to t...
read more
Mathematical
Matrix
Web Technologies
PHP
PHP Programs
DSA
PHP Program to Efficiently compute sums of diagonals of a matrix
Last Updated: 22 July 2024
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix.A00 A01 A02 A03A10 A11 A12 ...
read more
Matrix
Web Technologies
PHP
PHP Programs
DSA
school-programming
CBSE - Class 11
1
2
3
4
...
154
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !