打扫顺序表,没有重复
来源:互联网 发布:大数据用英语怎么讲 编辑:程序博客网 时间:2024/05/16 02:52
using System;
using System.Collections.Generic;
using System.Text;
/*问题描述:
* 已知顺序表La,
* 构造Lb,
* 要求Lb中只包含顺序表La中所有不相同的值
* Purge:使洁净, 使净化, 清洗, 清除, 使(机构)变得廉洁起来
*/
namespace UniqueItem
{
class Program
{
static void Main(string[] args)
{
List<int> left = new List<int>();
Random rd = new Random();
Console.WriteLine("生成数据:");
for (int i = 0; i < 10; i++)
{
int temp = rd.Next(0, 4);
left.Add(temp);
Console.Write(temp + " ");
}
Console.WriteLine("/n/n/n");
List<int> result = Purge(left);
foreach (int node in result)
{
Console.Write(node + " ");
}
Console.WriteLine();
Console.ReadLine();
}
public static List<int> Purge(List<int> left)
{
if (left.Count == 0)
{
return null;
}
List<int> result = new List<int>();
result.Add(left[0]);
for (int i = 1; i < left.Count; i++)
{
for (int j = 0; j < result.Count; j++)
{
if (left[i] == result[j])
{
goto NoSame;
}
}
result.Add(left[i]);
NoSame: ;
}
return result;
}
}
}
- 打扫顺序表,没有重复
- 打扫打扫打扫
- 顺序表清除重复元素
- 打扫打扫,重整旗鼓
- 打扫打扫,重新开张
- 撒打扫打扫
- 打扫打扫的
- 打扫打扫的
- 宿舍打扫打扫
- 啊打扫打扫大
- 利用顺序表删除重复元素
- 数据结构顺序表删除重复元素
- 送到房间打扫房间打扫
- 不重复顺序递归
- RocketMQ顺序、重复问题
- 删除重复的数(顺序有序表)
- 合并两个顺序表,并删除重复元素
- 顺序表——插入不重复元素
- 读书笔记以及失效分析心得。
- 非常好的学习网站&维基百科
- 堆和栈的区别(重要!!!)
- 堆与栈的区别
- 电容的作用
- 打扫顺序表,没有重复
- php中mysql的事务处理
- Head First C# 中文版 第九章 读写文件 page401
- H.264 标准详解
- const用法
- VC判断目标主机是否存活,模拟系统的ping
- (转贴) 房产术语:租售比
- 今天实在很生气
- 回调函数