/avatar.jpg
keep hungry keep foolish.

算法模板整理

STL vector 支持 size() empty() clear() 清空 front()/back() 数组头尾元素 push_back()/pop_back begin()/end() 首尾元素 支持字典序比较 pair first 第一个元素 second 第二个元素 string size()/length 返回长度 empty() clear() substr(a,b) 得到一个下标位a长度位b的子字符串 substr(a) 得

呼叫中心术语记录

IVR (Interactive Voice Response ):交互式语音应答 ASR (Automatic Speech Recognition)将人的语音转换为文本的技术 PSTN (Public Switched Telephone Network):公共交换电话网,即我们日常使用的

linux链接相关

程序函数库可分为3种类型:静态函数库(static libraries)、共享函数库(shared libraries)、动态加载函数库(dyn

rpath和patchelf

rpath全称是run-time search path。Linux下所有elf格式的文件都包含它,特别是可执行文件。它规定了可执行文件在寻找.so文件时

Windows WSL安装

第 1 步,启用 WSL 以管理员身份打开 PowerShell 工具并运行以下命令 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 第 2 步,启用“虚拟机平台” WSL 2 需要启用 Windows 10 的 “虚拟机平台” 特性。它独立于 Hyp

排序算法总结

不稳定排序算法

[堆排序]、[快速排序]、[希尔排序]、[直接选择排序]

稳定排序算法

[基数排序]、[冒泡排序]、[直接插入排序]、[折半插入排序]、[归并排序]

1.冒泡排序

void bubble_sort(vector<int> &arry){
    for(int i = 0 ;i< array.size()-1 ; i++){
        int index = 0 ;
        for(int j = 0; j < array.size()- 1 - i ;j ++){
            if(array[j] > array[j+1])
                swap(array[j],array[j+1]);
        }
    }
}

二叉树遍历

前序遍历 void preorder(Node * head){ if(head!=null) { cout << head -> val; preorder(head->left); preorder(head->right); } } void preorder(Node * head){ if(!head) return ; stack<Node *> s; s.push(head); while(!s.empty()){ Node * tmp = s.top(); s.pop(); cout << tmp.val; if(tmp->left) s.push(tmp->left); if(tmp->right) s.push(tmp->right); } } 中序遍历 void inorder(Node * head){ if(head!=null) { inorder(head->left); cout << head -> val; inorder(head->right); } } void inorder(Node * he