矩阵对角线打印

58面试后台研发岗,我的内心非常拒绝,硬着头皮面,面面相觑。

  1. 数据库MySQL的索引,什么叫事务。
  2. .TCP/IP的三次握手的底层,http协议的请求和响应的格式。
  3. hash的存储方式,hash解决冲突的办法,multimap的底层。

手撕代码1:二叉树的遍历  2:对角线打印矩阵元素

#include
#include
#include
#include
using namespace std;
void printMatrix(vector>matrix,int n)
{
    int x1=0,y1=n-1;
    int x2=0,y2=n-1;
    for(int cnt=0;cnt<2*n-1;cnt++)
    {
        for(int i=x1,j=y1;i<=x2&&j<=y2;i++,j++)
        {
            cout<<"("<>grid(n,vector(n,0));
	for(int i=0;i

 

你可能感兴趣的:(面试)