- 博客(18)
- 收藏
- 关注
原创 Lab: Allow List Checking
For this lab you will be making a program to simulates the search for fraudulent transactions. Your program will be given two command line arguments. One for the allow list and one for the transactions you are to check. The allow file will have valid 10 di
2020-12-18 01:50:28 236
原创 3.14 Lab: Recurrence Evaluation
// Add imports as neededimport java.util.Scanner;import java.math.BigInteger;public class Main{ public static void main(String[] args) { final Scanner cin = new Scanner(System.in); BigInteger []a1 = new BigInteger[5555]; .
2020-12-18 01:49:20 134
原创 Lab: Dodge Ball
Lab: Dodge BallOur game of Dodge Ball is a game for two Players: A and B, where players alternate moves, with A going first. A is given an n by n grid to fill out and B is given a length n row to fill out.A fills in one of the upper rows of a grid with X
2020-12-18 01:47:07 148
原创 Lab: Search Time
Lab: Search TimeThe difference in performance between linear and binary search is stark. In this lab you are to create a program to compute the worst case number of probes needed for a linear and binary search and output the number of probes binary search
2020-12-18 01:45:52 138
原创 2.9 Lab: Histogram
2.9 Lab: HistogramComplete the static method histogram() that takes an ArrayList of non-negative integers and returns an array of length m+1 whose ith entry is the number of times the integer i appeared in the list, where m is the largest entry in the lis
2020-12-18 01:45:05 86
原创 2.8 Lab: Relatively Prime Array
Complete the given code so that makeGrid creates an n-by-n boolean array, result, such that result[i][j] is true if and only if i and j are relatively prime (also called coprime i.e. they have no common factors). Thus, each entry in the grid is for a pair
2020-12-18 01:43:51 72
原创 2.7 Lab: Circular Shift
2.7 Lab: Circular ShiftThis lab is an introductory lab to make sure you know how to submit your code. Note that you are welcome to use your own IDE and copy your code into the labs, or to use the code editor that is provided.A string s is a circular shif
2020-12-18 01:42:10 252
原创 spell checker
import java.util.*;import java.io.BufferedInputStream;import java.io.BufferedReader;import java.io.FileNotFoundException;import java.io.FileReader;public class Main{ // Return a scanner for the given file with the given name. private static
2020-12-03 13:13:40 163
原创 what is this
import java.util.*;public class Main {public static void main(String[] args) {Scanner scnr = new Scanner(System.in); Queue<Integer> queue = new LinkedList<>(); Stack<Integer> stack = new Stack<>(); PriorityQueue<In
2020-11-12 13:54:39 92
原创 event simulation
/*For this lab you will be building the start of a very basic event simulation. Your program will read in lines of the formevent id periodfor all of the events that your system is to track. The id of an event is a unique non-negative integer for identif
2020-11-11 01:03:36 146 1
原创 polygon
//关键是要去处理角度问题import javax.swing.;import java.awt.;import java.awt.geom.Ellipse2D;import java.awt.geom.Line2D;import java.awt.geom.Point2D;import java.util.*;import java.util.List;public class PolygonFrame extends JFrame{// Build a method to compa
2020-10-29 13:21:22 161
原创 node.java
import java.util.Arrays;// Note you can edit, add, or remove the comments if you wish, They are// just there to help you get started.//// We will use the following Node class to build a simple bare (not wrapped in// a list class) linked list implement
2020-10-29 13:19:51 117
原创 图论 找化合物
public class Main {/******* problem 01*/private static void problem01(){Scanner input = new Scanner(System.in);String caseStr = input.nextLine();int caseNum = Integer.parseInt(caseStr);input.n...
2020-05-17 22:38:35 117
原创 maze
/*For this one, it is easily to know, it need use the dijkstra way to do that, So we needto do two things, the first it is turn the data to the AM, and use AM data to do thedijkstra way.And in dijk...
2020-05-04 17:04:34 168
原创 迷宫问题
/*没细想dij好做,但是学的很渣就是非常暴力搜索甚至没有加剪枝复杂度很高每个方向都探查遍走过的进入一个数组最后在进行比较Astar也可以但是还没学自己也没搞明白*/import java.io.FileInputStream;import java.io.FileNotFoundException;import java.util.Scanner;public cl...
2020-05-04 06:24:28 113
原创 作业1
import javax.swing.JFrame;import javax.swing.JLabel;import java.awt.*;import java.awt.event.MouseEvent;import java.awt.event.MouseMotionAdapter;class Frame1 extends JFrame {public Frame1() {try...
2020-04-27 17:50:21 173
原创 经历所有的点在返回求最短路(深度搜索剪枝 )
import java.util.Scanner;public class Problem3 {public static int currentMinLength = -1;public static int currentLength = 0;public static void main(String[] args) { Scanner scanner = new Scan...
2020-04-23 03:49:22 213
原创 点鼠标出小球
import java.awt.Color;import java.awt.Graphics;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import j...
2020-04-12 11:55:31 209
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人