
数据结构
文章平均质量分 76
Unity探路者
这个作者很懒,什么都没留下…
展开
-
折半查找的递归实现和非递归实现
namespace 折半查找实现 { class Program { static void Main(string[] args) { int[] nums = { 1, 6, 0, 3, 5, 7, 9, 5, 23, 2, 43, 64, 644, 5, 8 }; //int[] nums = {原创 2017-10-22 12:56:32 · 522 阅读 · 0 评论 -
堆排序
堆排序: class Program { static void Main(string[] args) { int[] nums = { 1, 4, 8, 0, 3, 6, 9, 2 }; HeapSort(nums); for (int i = 0; i < nums.Length原创 2017-10-22 15:03:49 · 186 阅读 · 0 评论 -
求指定钢条长度的最大价格
带有重复计算: class Program { static void Main(string[] args) { // 索引代表 钢条的长度,值代表相应的价格 int[] prices = { 0, 1, 5, 8, 9, 10, 11, 17, 20, 24, 30 }; C原创 2017-10-22 14:41:27 · 229 阅读 · 0 评论 -
链表的初始化、遍历、删除、插入、判断是否为空、求长度 C语言实现
#include #include #include typedef struct Node { int data; struct Node *PNext; } NODE,*PNODE; PNODE Init(); void Traverse(PNODE pHead); bool Insert(PNODE pHead,int pos,int val); bool Dele原创 2017-10-23 10:25:32 · 2376 阅读 · 0 评论