Queue

A queue follows FIFO (first in first out). In a queue, elements are added and removed from opposite sides. There is also a data structure called a deque, short for double-ended queue, and pronounced “deck”. In a deque, you can add or delete elements from both ends. Adding to a queue is called enqueue and deletions are called dequeue. A doubly linked list that maintains pointers to the head and tail (both ends, usually with sentinel nodes) can implement an efficient queue....

November 12, 2023 · 1 min · 142 words · fgh

Stack

A stack is an ordered collection of elements where elements are only added and removed from the same end. Another term used to describe stacks is LIFO, which stands for last in, first out. The characteristic that makes something a “stack” is that you can only add and remove elements from the same end. It doesn’t matter how you implement it, a “stack” is just an abstract interface. Stacks and recursion are very similar....

November 9, 2023 · 2 min · 224 words · fgh

Recursion

Recursion is a problem solving method. In code, recursion is implemented using a function that calls itself. Any iterative algorithm can be written recursively. Iterative algorithms use for loops and while loops to simulate repetition. Recursive algorithms use function calls to simulate the same logic. Base cases are conditions at the start of recursive functions that terminate the calls. Think from one level above the base case. Think from leaf node’s perspective....

November 9, 2023 · 1 min · 101 words · fgh

Analysis of Algorithms

1.4 Analysis of Algorithms, LeetCode’s Interview Crash Course: Data Structures and Algorithms

November 4, 2023 · 5 min · 893 words · fgh

Hugo PaperMod Theme Setup

1 2 3 4 5 6 7 8 9 10 11 # install hugo: https://gohugo.io/installation/ hugo version # hugo v0.119.0-b84644c008e0dc2c4b67bd69cccf87a41a03937e linux/amd64 BuildDate=2023-09-24T15:20:17Z VendorInfo=gohugoio hugo new site <name of site> -f yml cd <name of site> # install hugo-PaperMod git submodule add --depth=1 https://github.com/funfungho/hugo-PaperMod.git themes/PaperMod git submodule update --init --recursive # needed when you reclone your repo (submodules may not get cloned automatically) hugo new posts/first_post.md KaTeX: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 <!...

October 27, 2023 · 1 min · 182 words · fgh