Skip to content

Instantly share code, notes, and snippets.

@njang
njang / data-structures.md
Created February 21, 2018 15:16
Data Structures: Stacks, Queues, Linked Lists and Tries

Data Structures: Stacks, Queues, Linked Lists and Tries

These are data structures programmers are expected to at least know about. While we don't implement them directly, they are the building blocks of many algorithms. Let's look at what they are, and how they work.

Stacks

A stack is kind of like an Array, but more resembles a stack of things in real life. You can plop things onto them and pop things off and that's it. It's LIFO. Last in first out. It's the opposite of how you want to stock a restaurant. It's more like a stack of plates.

import praw, time, csv, random, itertools, requests
BOT = 'spirit_of_mckenna'
PASSWORD = "" #not actual password
KEYWORD = "mckenna"
SLEEP_MESSAGE = "Sleeping for 12 hours..."
BY_LINE = " -Terence McKenna"
USER_AGENT = "When people reference McKenna, I provide a quote of his, /u/spirit_of_mckenna"
SUBREDDITS = [ 'test',
'psychonaut',
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
padding: 30px;
text-align: center;
@njang
njang / index.html
Created November 24, 2017 19:20
Abstract Art // source http://jsbin.com/ludeta
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Abstract Art</title>
<style id="jsbin-css">
.box-1 {
background-color: red;
height: 100px;