A data structure called QUEUE operates data based on First In, First Out. When we talk about queue implementation, we need to implement circular QUEUE. We can use this QUEUE implementation in banking software.
Read More »Implement Insertion Sort in PHP
Insertion sort is a sorting algorithm like bubble sort and selection sort. In practical life, we can use insertion sort. It’s worst-case complexity O(n^2). Check the complete code below:
Read More »Implementation of bubble sort in PHP
The most straightforward sorting algorithm ‘bubble sort’ bubbles up the element to the correct position each time compared with the adjacent items.. Check the complete code below:
Read More »Implement Selection Sort in PHP
We need to use two ‘for loop’ for the selection sort algorithm. The complexity of this algorithm is O(n^2). Check the complete code below:
Read More »Binary Search in PHP
If we want to search for an item in the array using a binary search algorithm, the array items must be sorted by default. Check the complete code below:
Read More »Linear Search in PHP
Linear search is a searching technique which search for an item from an array by going through each items of that array. Check the code below:
Read More »Create Pyramid Using asterisks in PHP
To create a pyramid using asterisks in PHP, first, we need to specify the pyramid’s height using a variable like $height = 5. Then we need to add two ‘for loop’ and one ‘while loop’ like below:
Read More »How Can I Implement Stack in PHP?
A Stack is a linear data structure that follows a particular order in which the operations are performed. The order is LIFO(Last In, First Out). We can implement it in both a procedural or object-oriented approach. Here I follow the procedural process.
Read More »