Search Results


18 matches found for 'stack'

Stack Memory vs. Heap Memory

Stack Memory The stack memory is used within a context of a thread. It is called stack memory since memory blocks are allocated in LIFO order, based on the function call stack.


Java Essentials

... reserved for allocation of reference types (i.e. Objects). The heap is generally slower than the stack but the heap is able to use a significantly larger amount of memory than the stack.


4 Line Depth-first Search

... topological sorting. The key characteristic of DFS is that it is recursive in nature, thus a stack becomes very useful when defining the algorithm. The algorithm def dfs(parent, vertex): for neighbor in vertex: if neighbor not in parent: parent[neighbor] = vertex dfs(parent, vertex) The pseudocode above represents the core algorithm of depth-first search.


Iterative In-Order Traversal

... recursive approach internally takes advantage of the fact that recursive calls are stored into a stack - or the call stack. Thus, when thinking about the iterative approach, we should simply use a stack data structure.


Working with Production at Amazon Retail Website

... most standard bare minimums. This is to ensure that if something goes awry with the Development stack, the Production stack will never be impacted and continue to be operational.


Python Essentials

... # deque([2, 3, 4]) Stack # Lists are the easiest way to represent stacks, since .append() is synonymous with a stack push # and .pop() is synonymous with a stack pop stack = [] stack.


Webpack: Usage Examples

... since 2012 and it is a very popular tool nowadays. You'll see it mentioned in a lot of front-end stacks. I've personally used it to power this blog and a handful of my own React projects such as https://classic-ah.


Useful Links

This is a personal list of useful resources for improving web stacks, frameworks, development, UX, whatever that I come across! Software Engineering The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) Encryption vs.


Javascript Essentials

Hoisting Hoisting is JavaScript's default behavior of moving declarations to the top. Given the following Javascript code, what is the expected output, and why? fcn2(); fcn1(); function fcn2(){ alert("hi"); } var fcn1 = function(){ alert("hey") } The expected output is a pop up alert that says "hi", followed by an error that fcn1 isn't defined.


Build a Binary Tree with Pre-order and In-order traversal data

... Recursive calls will take up more space than iterative solutions (due to the call stack) and creating new sub-arrays inside each recursive call will take up even more space.


What is DDD? What is CQRS?

... Sourcing, the store of events is the write model The write model has a full command-processing stack with business logic, input validation, and business validation to ensure that everything is always consistent for each of the aggregates (each cluster of associated objects treated as a unit for data changes) in the write model.


Phone Number Mnemonics in Python

... concatenation (i.e. new_str = old_str + some_character) at each iteration in the function call stack. The problem with this is that any string concatenation operation by itself is a \(O(n)\) operation because the old string has to be copied character-by-character into the new string, with the new character appended at the end.


Asynchrony vs. Multithreading

... need to handle deadlocks, mutexes Difficult to debug Each thread has a separate set of registers, stack, etc. that it maintains Keep in mind that asynchronous programming and multithreading aren't exactly mutually exclusive depending on the platform; for example with Java 8's CompleteableFuture, asynchronous programming is actually achieved using multithreading.


Scaling Instragram Infrastructure

... upload time Scaling Used a pod or group of Django, RabbitMQ to represent the application stack for one region Problem #1: Initially memcached would be in each local pod, but that lead to data staleness (memcached data from pod #1 could be stale vs.


Algorithm Handbook

... sort is basically doing a DFS traversal in post-order, and adding the results to a stack. Strongly connected components in digraphs are like connected components in simple graphs.


Data stores in Software Architectures

... globe, resulting in very slow download times. To make matters worse, front-end assets in modern stacks are growing larger and larger in size. Server-side rendering is one way to alleviate the issue, so that the user can delegate the downloading of these assets to the rendering server.


Web Development 101

... for the ongoing trend of faster computers and cheaper prices. Horizontal scaling is all about stacking a row of computers horizontally, and combining the power of all the computers in the row to deliver your server's needs.


Flip adjacent colors in a 2D matrix

... the entry point first. This makes BFS an excellent choice. Solution While DFS works like a stack, BFS works like a queue. A deque is used in the solution to save performance on removing the HEAD element (as shown by .