排序
【数据结构】链栈的基本操作(C++实现)
什么是链栈 链栈是一种基于链表实现的栈(Stack)数据结构。栈是一种后进先出(Last In, First Out,LIFO)的数据结构,而链栈通过链表的形式来组织栈中的元素。链栈与顺序栈相比,不需要预先分...
【C】if-else if-else和switch-case
if-else if-else #include<stdio.h> int main() { int type=0; scanf('%d',&type); if (type==1) printf('早'); else if (type==2) printf('中'); else if (type==3) printf('晚'); else...
【C++】使用cpp-httplib库实现http通讯
下载 GitHub:https://github.com/yhirose/cpp-httplib 仅需下载头文件httplib.h后导入至项目中即可,非常简单 服务端 现在以我的个人通讯录管理系统项目中的云端备份功能为例,简单的讲解这个...
【C】顺序数组的二分查找
关键函数 int binarySearch(int arr[],int n,int k){ int low=0,mid,high=n-1; while(low<=high){ mid = (low + high)/2; if (k==arr[mid]){ return mid; } if (k<arr[mid]){ high = mid ...
【C】在文件中定位
要实现在C语言中打开文件后对文件定位,需要学习两个函数: rewind和fseek。 rewind函数用于将当前文件指针的位置定位到文件头。 用法:rewind(fp); fseek函数用于将当前位置指针移动到距离第三...
【C】合并有序数组
#include <stdio.h> int main(){ int M,N; int a[]={1,3,5,6,8},b[]={1,2,5,7,8,9}; M=sizeof(a)/sizeof(a[0]); N=sizeof(b)/sizeof(b[0]); int c[M+N]; int i=0,j=0,k=0; //当有任何一个数...