Design A Linked List Class
For a given linked list, it has 3 common methods: GetByIndex, AddTo(Head/Tail/ToIndex), Delele. Similar to SQL’s CURD. Let’s see how to design a linked list class. 707. Design Linked List
For a given linked list, it has 3 common methods: GetByIndex, AddTo(Head/Tail/ToIndex), Delele. Similar to SQL’s CURD. Let’s see how to design a linked list class. 707. Design Linked List
Let’s take a look at a easy problem on Leetcode 203. Remove Linked List Elements. We will demonstrate how to remove elements from a linked list.
The trick of traverse a matrix in spiral order is that we need to have flags to keep the boundary. Let’s check LeetCode problerm 54. Spiral Matrix
Let’s take a look at a easy problem on Leetcode 704. Binary Search. Besides the brute-force O(n) solution, it’s not hard to get the O(log(n)) solution from the constrains unique
and sorted in ascending order
. Binary search is one of the most basic algorithms we are using, but most people couldn’t get the right code.
Based on Golang’s function type spec:
1 | A function type denotes the set of all functions with the same parameter and result types |
When you are following functional programming style guide to write JavaScript, you may find that it’s hard to deal with asynchronous since async
function always return promises. So code like below will resolve the promises at same time instead of waiting for them.
HTTP requests and HTTP responses use header fields to send information about the HTTP messages. Header fields are colon-separated name-value pairs that are separated by a carriage return (CR) and a line feed (LF). A standard set of HTTP header fields is defined in RFC 2616. There are also non-standard HTTP headers available that are widely used by the applications. Some of the non-standard HTTP headers have an X-Forwarded prefix.
NodeJS stream
is one of the most powerful modules built-in. If you need to serve files on S3 through NodeJS service, a good idea is to leverage the compatibility of stream, especially if you want to serve big files.
If you are an enterprise application developer, you may want to add watermark to your application. You can use below JS to applications like Confluence, Jira and so on. Just need to paste below JS code.