摘要:
1 void selectSort(int array[], int n) { 2 int current; 3 for (current = 0; current < n; ++current) { 4 int i, min = array[current], minIndex = current 阅读全文
摘要:
1 void bubbleSort(int array[], int n) { 2 int lastElement; 3 for (lastElement = n-1; lastElement > 0; --lastElement) { 4 int i, flag = 0; 5 for (i = 0 阅读全文
摘要:
题目描述 小蒟蒻最近对字符串的子序列着了迷。一个字符串 s 被称作另一个字符串 S 的子序列,说明从序列 S 去除某些元素但不破坏余下元素的相对位置(在前或在后)可得到序列 s 。 小蒟蒻想到了如下的问题:给出一个由’a’, ’b’, ’c’ 组成的长度为 n 的字符串。 定义一个子序列 T 的价值 阅读全文