当前位置:网站首页>面试复盘2(面试回答不好的地方做总结)
面试复盘2(面试回答不好的地方做总结)
2022-07-15 19:39:00 【QQ851301776】
创作人QQ:851301776,邮箱:[email protected],欢迎大家一起技术交流,本博客主要是自己学习的心得体会,只为每天进步一点点!
个人座右铭:
1.没有横空出世,只要厚积一定发。
2.你可以学历不高,你可以不上学,但你不能不学习
问题1:实现单链表的反转?
面试的时候写出来了,但是写的不完成。(我个人觉得这个方面,简单明了)
#include <stdio.h>
typedef struct node_{
int data;
struct node_ *p_next;
}node;
void list_reveral(node *h)
{
if((!h) || (!h->p_next)) return;
node *tmp1 = h;
node *tmp2 = NULL;
for(tmp1 = tmp2->p_next; tmp1 != NULL; tmp1 = tmp1->p_next)
{
tmp2 = tmp1->p_next;
tmp2 = tmp1;
}
h->p_next = NULL;
h = tmp1;
return ;
}问题2:冒泡
当时没写完,所以回到家,写完
void sort(void *p, int len)
{
if((!p) || (len < 1)) return ;
int i, j ;
for(i =0;i<len-2;i++)
{
for(j=len-1; j> 0; j--)
{
if(p[i] > p[j])
{
int tmp = (int)p[i];
p[i] = p[j];
p[i] = (void)tmp;
}
}
}
return ;
}问题3:判断链表是否有环?
typedef struct node_{
int val;
struct node_ *p_next;
}node;
int check_list_rings(node *h)
{
if((!h) || (!h->p_next)) return -1; //error
node *tmp1 = h;
node *tmp2 = h->p_next->p_next;
for(;tmp1 != NULL, tmp2 != NULL; tmp1 = tmp1->p_next, tmp2 = tmp2->p_next->p_next)
{
if(tmp1 == tmp2) return 1; //rings
}
return 0;//no rings
}问题4:如果调试在线进程
gdb attach pid
边栏推荐
- CUDA和cuDNN安装教程(超详细).卸载CUDA、安装CUDA的nsight visual studio edition失败的情况、VS2019+CUDA11.1新建项目里没有CUDA选项
- Codeforces Round #804 C The Third Problem
- Unity Shader——CGInclude文件cginc
- 信息检索顶会SIGIR2022最佳论文奖出炉,墨尔本理工大学最佳论文,UMass大学等最佳短论文
- [mt2109] rectangle
- APP自动化测试框架搭建(七)--Airtest基础操作
- 5-Redis架构设计到使用场景-存储原理-数据类型底层结构
- Codeforces Round #804 B Almost Ternary Matrix
- Help, update to Siyuan v2.0.27, dark+ theme adaptive width problem
- VS2019+CUDA11.1新建项目里没有CUDA选项
猜你喜欢
Help, update to Siyuan v2.0.27, dark+ theme adaptive width problem

HCIP第八天笔记

5-Redis架构设计到使用场景-存储原理-数据类型底层结构

Code forces round # 802 B. Palindromic Numbers

Easy gene encode histone chip SEQ and transcription factor chip SEQ data standard and processing flow

kingbaseES V8R6集群备份恢复案例之---备库作为repo主机执行物理备份

Codeforces Round #806 (Div. 4) A - G

一键生成VR全景图展示

用户登录和注册功能带验证码

Win11系统.NET Framework 3.5怎么启用?
随机推荐
华泰证券开户有陷阱吗?网上开户安全吗?
V-model and Differences between sync modifiers
SQL也能做AI ?没错!MLOps Meetup V3 回顾|OpenMLBD+SQLFlow+Byzer
kingbaseES V8R6集群备份恢复案例之---备库作为repo主机执行物理备份
如何部署PolarDB for PostgreSQL?
Win11提示Outlook搜索错误怎么办?Win11提示Outlook搜索错误
Creativity of project-based learning in children's programming
Timeline和Playable导致Unity崩溃问题记录
go语法-延迟调用defer
There is no CUDA option in vs2019+cuda11.1 new project
国内开源镜像网站汇总
会用redis吗?那还不快来了解下redis protocol
Extension and expansion of steam classroom education concept
Modify WiFi for Xiaomi camera
语言AI原来知道自己的回答是否正确!伯克利等高校新研究火了,网友:危险危险危险
怎么解决系统高并发问题的思路?看完你就彻底懂了。
Interpreting the teaching principles of robot programming course
CSDN博客专家专属荣耀奖励来了
Network trusted identity authentication
5-Redis架构设计到使用场景-存储原理-数据类型底层结构