DEV Community

Debajyoti Das
Debajyoti Das

Posted on

DS implementaions using PHP

Doubly Linked List:


use SplDoublyLinkedList;

$a = new SplDoublyLinkedList;
$arr=[1,2,3,4];
for($i=0;$i<count($arr);$i++){
   $a->add($i,$arr[$i]);
}
$a->push(2);
$a->push(5);
echo $a;
Enter fullscreen mode Exit fullscreen mode

HashMap
Queue
Heap
Stack

Top comments (0)