Skip to content

duochen13/Hikaru-Nara

Repository files navigation

HashTable

sorted(bca) -> abc || keys = [0,1,0....0], len(keys) = 26

LinkedList

Array

two pointer

Heap

Arrays.sort(intervals, new Comparator<int[]>(){ public int compare(){}})
Input can be a streaming of data (access with get() method) instead of a list, or divide & conquer

Stack

921, 1514 minimum inserts to make valid (), stack or one pass sol
42 & 84, care about condition of pushing to stack

Tree

BST -> BT -> N-ary Tree

DFS

694-221
TLE, tree dp + purning TBF, undirected graph
DAG, states: {unvisted, visiting, visited}
DAG

BFS

BFS in DAG, Toposort, course schedule emmm

Backtracking

sorted or not, res[:] or res

DP

dp[i,j]: LCCA of A[:i] and B[:j],  dp[i,j] = dp[i + 1][j + 1] + 1 if A[i] == B[j]
dp[i,j]: LISS of nums[i:j], dp[j] = max(dp[j], dp[i] + 1) if nums[i] < nums[j]
dp[i]: s[:i] is workbreakable, dp[j] = dp[i]   if A[i:j] in wordDict, 140 TLE
dp[i,j]: number of operations from wordA[:i] to wordB[j:].  dp[i][j] = dp[i - 1][j - 1] if wordA[i] == wordB[j], dp[i][j] = 1 + max(insert, delete, swap)  

Algorithms

If it's how random.shuffle() implemented

Divide & Conquer

Bit Manipulation

OOD

System Design

Security

Vim

Key Bindings | Pattern

Jump based on relativenumber | <number><direction>
Visual mode: 5j(jump down 5 lines), 3i(jump up 3 lines), very helpful when enable 'set relativenumber', (no ruler plz)

Execute program within editor | <shift> + ':' + '!' + <command>
Sometimes I need to :wq and run some program and go back to editor, but !<command> helps run program within vim. If <command> is empty, :! will simply run last command

Comment / Uncomment multiple lines
<control> + v: enter visual mode, <esc> + v may not work, it will select blocks of lines instead of first column in the next step
Select the lines that you want to comment / uncomment
Comment: <shift> + i: Enter the insertion mode, type the comment sign: #, // etc. Then <ESC>
Uncomment: d

Navigate between file structure and file content
vim . in current directory
:NERDTree
<control> + w(double click) to navigate between windows 

Userful Plugins:

gmarik/Vundle.vim: Best package manager for lazy people(maybe?)
preservim/nerdtree: File structure and menu bar
Valloric/YouCompleteMe: Finally works in macos 10.14 
zxqfl/tabnine-vim: Neural Network + YouCompleteMe, but slows vim down
morhetz/gruvbox: Best color scheme for py i guess? not suitable for cpp though

BGM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published