Skip to content

Instantly share code, notes, and snippets.

View antoniopicone's full-sized avatar

Antonio Picone antoniopicone

View GitHub Profile
@antoniopicone
antoniopicone / Stack.php
Last active August 23, 2016 10:20
A simple PHP implementation of a Stack
<?php
// I could use array_push and array_pop with an array, as PHP already implements internally a stack with a doubly linked list
class Node {
public $data;
public $next;
@antoniopicone
antoniopicone / Queue.php
Last active August 23, 2016 10:27
A simple PHP implementation of a Queue
<?php
class Node {
public $data;
public $next;
public function __construct($data)
{
$this->data = $data;