2024年7月23日
摘要: ###### url_manager.py ###### class UrlManager: def __init__(self): self.new_urls = set() self.old_urls = set() def add_new_url(self, url): if url is N 阅读全文
posted @ 2024-07-23 18:46 星火splanet0 阅读(1) 评论(0) 推荐(0) 编辑
  2024年7月21日
摘要: //FreshJuiceTest.java class FreshJuice { enum FreshJuiceSize{SMALL, MEDIUM, LARGE} FreshJuiceSize size; } public class FreshJuiceTest{ public static v 阅读全文
posted @ 2024-07-21 18:32 星火splanet0 阅读(2) 评论(0) 推荐(0) 编辑
  2024年7月17日
摘要: /*冒泡排序,英语:Bubble Sort,是一种简单的排序算法。 它重复地走访过要排序的数列,一次比较两个元素, 如果他们的顺序,如:从大到小、首字母从A到Z。 错误就把他们交换过来。*/ #include<stdio.h> void bubble_sort(int arr[], int len) 阅读全文
posted @ 2024-07-17 17:20 星火splanet0 阅读(1) 评论(0) 推荐(0) 编辑
  2024年7月15日
摘要: 普通递归与尾递归的区别 普通递归(图): 尾递归(图): 对比普通递归和尾递归,两者的求和操作的执行点是不同的: 普通递归: 求和操作是在“归”的过程中执行的,每层返回后都要再执行一次求和操作。 尾递归: 求和操作是在“递”的过程中执行的,“归”的过程只需层层返回。 阅读全文
posted @ 2024-07-15 19:03 星火splanet0 阅读(0) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<string.h> #include<stdlib.h> //双层for循环 char *nestedForLoop(int n){ //nested --嵌套 int size = n * n * 26 + 1; char * res = ma 阅读全文
posted @ 2024-07-15 16:54 星火splanet0 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //while循环 int whileLoop(int n){ int res = 0; int i = 1;//初始化条件变量 //循环求和:1+2+3+...+n while (i <= n){ res += i; i++; } return res; } i 阅读全文
posted @ 2024-07-15 16:52 星火splanet0 阅读(0) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> //for循环 int forLoop(int n){ int res = 0; //循环求和:1+2+3+...+n for (int i = 1; i <= n; i++){ res += i; } return res; } int main(){ int 阅读全文
posted @ 2024-07-15 16:24 星火splanet0 阅读(0) 评论(0) 推荐(0) 编辑