写一个算法在有序链表中插入一个节点。
Write an algorithm to insert a node in a sorted linked list.
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: medium
分类: Algorithms
标签: algorithm
参考答案摘要
答案 在有序链表中插入节点的算法。 情况1: Check if the linked list is empty then set the node as head and return it. New_node-> Next= head; Head=New_node 情况2: 在中间插入新节点 While( P!= insert position) { P= p-> Next; } Store_...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。