Author Archives: onegazhang

mmap and vm.max_map_count

mmap failed with error message: Cannot allocate memory (12). The root cause is the process reached vm.max_map_count limit. Then number of virtual memory areas (VMAs) can be found in /proc/<pid/maps file. This post demonstrated how to read map count and … Continue reading

Posted in Computer and Internet | Leave a comment

Data Structures and Algorithms

500 Data Structures and Algorithms interview questions and their solutions Top 10 algorithms in Interview Questions Data Structures and Algorithms: Annotated Reference with Examples 2018 Competitive Programmer’s Handbook by Antti Laaksonen Longest Increasing Subsequence Size (N log N) Sparse table … Continue reading

Posted in Books | Leave a comment

Algorithms

backtracking 2002 Backtracking by David Matuszek dynamic programming dynamic programming lecture Generating Permutations The Median-of-Medians Algorithm In-Place Merge Sort 2016 Quicksort Using Median of Medians as Pivot by Aviral Khattar Master Theorem 2014 NP completeness lecture Boyer-Moore algorithm Greedy algorithm … Continue reading

Posted in Uncategorized | Leave a comment

count number of bits

int countbits1(int n) { int res = 0; while(n) { ++res; n = n&(n-1);//change the right most bit to 0 } return res; } int countbits(int n) { int res = 0; for(;n;++res, n=n&(n-1)); return res; }

Posted in CPP | Leave a comment

Graph

2015 Route Planning in Transportation Networks Fast and Exact Route Planning What algorithms compute directions from point A to point B on a map? 2011 Andrew Goldberg: Shortest Path Algorithms: Theory and Practice A Hub-Based Labeling Algorithm for Shortest Paths … Continue reading

Posted in Computer and Internet | Leave a comment

Tree

Binary Search Trees Ternary Search Trees By Jon Bentley and Bob Sedgewick Ternary search trees for autocompletion and spell checking 2015-09-28 Tree traversal – wikibooks.org Segment tree Binary Indexed Tree segment tree vs binary indexed tree vEB tree O(lg lg … Continue reading

Posted in Computer and Internet | Leave a comment

Auto completion and spell checker

2016 A Survey of Query Auto Completion in Information Retrieval 2015 Neural Networks for Text Correction and Completion in Keyboard Decoding 2015 Ternary search trees for autocompletion and spell checking 1000x Faster Spelling Correction algorithm (2012) – Wolf Garbe 2011 … Continue reading

Posted in Computer and Internet | Leave a comment