05 2023 档案

摘要:public static int height(BinTree T) { if (T == null) { return -1; } else { return Math.max(height(T.left), height(T.right)) + 1; } } /** Return the di 阅读全文
posted @ 2023-05-31 20:25 哎呦_不想学习哟~ 阅读(5) 评论(0) 推荐(0) 编辑
摘要:1.说明下列每对scanf格式串是否等价?如果不等价,请指出它们的差异。 (c) "%f"与"%f "。 在 `scanf` 函数中,`"%f"` 和 `"%f "` 这两种格式的区别在于后面的空格。 1. `scanf("%f", &variable);` 这种情况下,`scanf` 会读取并解析 阅读全文
posted @ 2023-05-31 18:23 哎呦_不想学习哟~ 阅读(120) 评论(0) 推荐(0) 编辑
摘要:public static void zorkSort(int[] A, int k) { int i; int n = A.length; i = 0; PriorityQueue<Integer> pq = new PriorityQueue<>(); while (i < k) { pq.ad 阅读全文
posted @ 2023-05-27 21:53 哎呦_不想学习哟~ 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-05-27 11:20 哎呦_不想学习哟~ 阅读(11) 评论(0) 推荐(0) 编辑
摘要:If we start with a hash table of size 2 and double when the load factor exceeds some constant. Why is this procedure for setting sizes suboptimal from 阅读全文
posted @ 2023-05-26 19:52 哎呦_不想学习哟~ 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-05-23 19:51 哎呦_不想学习哟~ 阅读(7) 评论(0) 推荐(0) 编辑
摘要:这是一个递归函数,其中有一个对自身的四次调用,并且在每次调用之后,输入的大小(N)减半。在函数的最后部分,有一个以Θ(N²)时间复杂度运行的函数g(N)。 现在让我们来计算这个函数的时间复杂度。 如果我们设T(N)为这个函数的时间复杂度,我们可以通过观察代码中的各个部分来构建一个递归方程。 递归的部 阅读全文
posted @ 2023-05-21 09:09 哎呦_不想学习哟~ 阅读(31) 评论(0) 推荐(0) 编辑
摘要:假设有一个循环数组,它的容量为capacity,当指针在最后一个位置的时候,再次前移时,就会变为这个数组的0号位置。如何用一条语句来实现? first = (first + 1) % capacity; 取模!!! 阅读全文
posted @ 2023-05-20 14:48 哎呦_不想学习哟~ 阅读(7) 评论(0) 推荐(0) 编辑
摘要:public class AltList<X, Y> { private X item; private AltList<Y, X> next; AltList(X item, AltList<Y, X> next) { this.item = item; this.next = next; } p 阅读全文
posted @ 2023-05-19 15:09 哎呦_不想学习哟~ 阅读(14) 评论(0) 推荐(0) 编辑
摘要:Next, Suppose we would like to invent a new ADT called MedianFinder which is a collection of integers and supports finding the median of the collectio 阅读全文
posted @ 2023-05-15 21:49 哎呦_不想学习哟~ 阅读(32) 评论(0) 推荐(0) 编辑
摘要:/* Represent a list of stuff, where all the "list" work is delegated * to a naked recursive data structure. */ public class SLList<Blorp> implements L 阅读全文
posted @ 2023-05-15 17:29 哎呦_不想学习哟~ 阅读(23) 评论(0) 推荐(0) 编辑
摘要:1 import java.util.ArrayList; 2 import java.util.List; 3 4 public class ArrayMap<K, V> { 5 private List<K> keys; 6 private List<V> values; 7 8 public 阅读全文
posted @ 2023-05-15 16:58 哎呦_不想学习哟~ 阅读(24) 评论(0) 推荐(0) 编辑
摘要:题目描述 1 import static org.junit.Assert.*; 2 import org.junit.Test; 3 4 public class TestArrayDequeGold { 5 @Test 6 public void testStudentArrayDeque() 阅读全文
posted @ 2023-05-13 16:09 哎呦_不想学习哟~ 阅读(18) 评论(0) 推荐(0) 编辑
摘要:解答 这告诉我们,将一个类实例化对象作为参数代入一个函数中,这个参数的类型是取决于这个类的静态作用域,而不是动态作用域,但是在调用方法时,如果实例化对象有相应的方法,那么就会调用动态作用域的方法。即文中的Corgi.的方法。 阅读全文
posted @ 2023-05-13 16:08 哎呦_不想学习哟~ 阅读(11) 评论(0) 推荐(0) 编辑
摘要:1 public class Horse { 2 Horse same; 3 String jimmy; 4 5 public Horse(String lee) { 6 jimmy = lee; 7 } 8 9 public Horse same(Horse horse) { 10 if (sam 阅读全文
posted @ 2023-05-07 16:16 哎呦_不想学习哟~ 阅读(14) 评论(0) 推荐(0) 编辑
摘要:1.Golden Rule of Equals For primitives, the line int y = x copies the bits inside the x box into the y box. For reference types, we do the exact same 阅读全文
posted @ 2023-05-05 10:24 哎呦_不想学习哟~ 阅读(154) 评论(0) 推荐(0) 编辑
摘要:怎么说呢,这个环境配置花了我几乎一天的时间(呜呜呜呜,我是傻逼),ok,现在我就来分享一下我遇到的坑,和排解方法。 这篇随笔分为两个部分,第一个就是关于git仓库的创建,为后面的grade做准备;第二个就是intellij的配置。 第一部分 1.首先是创建/选择一个目录 我的电脑是macbook,我 阅读全文
posted @ 2023-05-05 01:10 哎呦_不想学习哟~ 阅读(2085) 评论(0) 推荐(1) 编辑
摘要:题目描述: dcatenate(IntList A, IntList B):返回一个由A的所有元素组成的列表,后面是B的所有元素。可能会修改A。Don't use 'new'。 public static IntList dcatenate(IntList A, IntList B) { if(A 阅读全文
posted @ 2023-05-04 19:31 哎呦_不想学习哟~ 阅读(102) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示