随笔分类 - 数据结构与算法
摘要:Merge two sorted linked lists and return it as a sorted list. The list should be made by splicing together the nodes of the first two lists. 合并两个有序链表并
阅读全文
摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes conta
阅读全文
摘要:Given a 32-bit signed integer, reverse digits of an integer. Note:Assume we are dealing with an environment that could only store integers within the
阅读全文
摘要:Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each inp
阅读全文
摘要:一、时间复杂度与空间复杂度 二、原理与代码 1、直接插入排序 1)原理:从序列第二个数开始,将一个数插入到前面已经排序好的序列,记录数加一,以此类推。 2)代码: //直接插入 void insertSort(int a[],int n) { int temp; for (int i = 1; i
阅读全文