![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
文章平均质量分 53
Emma_Kong
这个作者很懒,什么都没留下…
展开
-
如何在子函数中改变main函数中的变量的值——阿里巴巴一面试题
今天去面试阿里巴巴的平台型产品经理,问了我一个C语言题(产品经理还让现场写程序,我也是醉了!!!),题目大概是 如何在子函数中改变main函数中的变量的值?比如main函数里定义一个int型变量a,初始值为1,如何在 fun 子函数中将a的值改成100。原创 2015-05-06 20:59:32 · 6877 阅读 · 0 评论 -
关于C/C++中的内存泄漏——程序员面试高频题
前几天面试多益网络的时候,面试官就问到了C/C++中的内存泄露问题。这也是很多公司面试时候的高频题,好吧,那就来学习下吧~到底什么是内存泄漏?是什么导致了内存泄漏?如何避免?又如何检测呢?1)什么是内存泄漏?简单来讲,内存泄露是指程序中一块不再使用的内存没有被释放,造成内存保持占用状态,使操作系统不能将内存分配给其它的程序(进程)。内存泄露不是一个立即会引发故障的错误,但是它将原创 2015-05-06 21:09:05 · 4051 阅读 · 1 评论 -
LeeCode 删除单链表中的某一特定值元素
题目:Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5Credits:Special原创 2015-05-19 20:42:54 · 980 阅读 · 0 评论 -
华为笔试&程序员面试宝典——选秀节目打分
题目描述: 选秀节目打分,分为专家评委和大众评委,score[] 数组里面存储每个评委打的分数,judge_type[] 里存储与 score[] 数组对应的评委类别,judge_type == 1,表示专家评委,judge_type == 2,表示大众评委,n表示评委总数。打分规则如下:专家评委和大众评委的分数先分别取一个平均分(平均分取整),然后,总分 = 专家评委平均分 * 0.6 +原创 2015-05-08 21:08:46 · 1118 阅读 · 0 评论 -
LeeCode 删除数组中某一特定值的元素,并返回新的数组长度
题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new len原创 2015-05-19 20:47:54 · 1686 阅读 · 0 评论 -
LeeCode 连接两个有序单链表
题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.C代码:/** * Definition for singly-linked list原创 2015-05-19 20:46:50 · 720 阅读 · 0 评论 -
LeeCode 单链表逆序
题目:Reverse a singly linked listC代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */struct ListNode* reverseList(struct List原创 2015-05-19 20:40:51 · 738 阅读 · 0 评论 -
LeeCode 判断两个二叉树是否相等
题目:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.C代码原创 2015-05-19 20:45:26 · 1201 阅读 · 0 评论