面试题
一、在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。
1、用C++实现:;
报错:./solution.h:23:5: error: control may reach end of non-void function [-Werror,-Wreturn-type]
原因:漏写了错误的返回值:return false;
2、用C语言实现,以下过程,无论输入什么数字都会输出“没有找到”,原因是:
一、对于分片式操作系统,cpu进行进程的调度经常采用的算法是:
二、
Given a singly linked list L: L 0→L 1→…→L n-1→L n,
reorder it to: L 0→L n →L 1→L n-1→L 2→L n-2→…
You must do this in-place without altering the nodes' values.
For example,
Given{1,2,3,4}, reorder it to1,4,2,3}.
三、
Sort a linked list in O(n log n) time using constant space csmplexity.
四、
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
五、在一个排序的链表中,存在重复的结点,请删除该链表中重复的结点,重复的结点不保留,返回链表头指针。 例如,链表1->2->3->3->4->4->5 处理后为 1->2->5
浙公网安备 33010602011771号