Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2015-12-01 (3 years ago) | | Not yet rated by the users | | Total: 106 | | All time: 9,194 This week: 842 |
|
Description | | Author |
This class can manage elements stored in a linked list.
It can values to a linked list by creating nodes that point to the next and previous elements of the list.
The class can also get elements by specific position, get the first and last elements.
It can also display the list of elements in the linked list. | |
|
Details
Include PHPLinkedList Class
<?php
require_once 'PHPLinkedList.php';
Initialize new LinkedList
$myLinkedList=new PHPLinkedList;
Add New Item To LinkedList
$myLinkedList->put(1);
$myLinkedList->put("Biswarup");
Append Item
$myLinkedList->append("biswarupadhikari@gmail.com");
Prepend Item
$myLinkedList->prepend("www.biswarupadhikari.com");
Get First Item From LinkedList
var_dump($myLinkedList->first());
Get Last Item From Linked List
var_dump($myLinkedList->last());
Get Item From LinkedList By Position
var_dump($myLinkedList->get(0));
var_dump($myLinkedList->get(2));
``
# Count Total Number Of Items
var_dump($myLinkedList->count());
# How to run test cases
$ php test.php
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.