00301J Java

SpringBoot+Vue+MySQL 高校学科竞赛平台 完整可运行版(源码+文档) 本项目基于SpringBoot+Vue+MySQL构建高校学科竞赛管理平台,覆盖学生、教师、领队教师、管理员四大角色,实现竞赛发布、报名、刷题、评分、公示等全流程闭环管理。系统架构清晰,技术主流,配套完整源码、数据库脚本、万字论文、开题报告、答辩PPT及部署文档,支持一键运行,适用于毕业设计、课程设计及院系二次开发,真正实现“开箱即用”。 阅读详情

Java Python Data Structures and Algorithms Hash Tables
CRICOS Provide Code: 00301J Page 1 of 3

Note:
• hashArray stores the key, value and state (used, free, or previously-used)
of every hashEntry.
We must store both the key and value since we need to check hashArray
to tell if there is a collision and we should keep probing until we find the
right key.
• put(), hasKey() and get() must take the passed-in key and call hash() to
convert the key into an integer. This integer is then used as the index for
hashArray.
• Java Students: If you use a private inner class for DSAHashEntry, then
put(DSAHashEntry will need to be private, otherwise it will be public.
• There are many hash functions in existence, but all hash functions must
be repeatable (i.e., the same key will always give the same index). A good
hash function is fast and will distribute keys evenly inside hashArray.
Hash Tables

Updated: 21st
July, 2023

Aims
• To implement a hash table.
• To make the above hash table automatically resize.
• To save the hash table and reload it from a file.

Before the Practical
• Read this practical sheet fully before starting.

Activities
g
1. Hash Table Implementation
Following the lecture slides as a guide, Create DSAHashTable class and a companion
class called DSAHashEntry to implement a hash table with a simple hash function. Use
linear probing first since it’s easier to think about, then convert to double-hashing.
Assume the keys are strings and the values are Objects.
Data Structures and Algorithms Hash Tables
CRICOS Provide Code: 00301J Page 2 of 3

Note:
• Of course, the latter depends on the distribution of the keys as well, so it’s
not easy to say what a good hash function will be without knowing the
keys.
For the purpose of this practical, just use one of the hash functions from
the lecture notes.
• Use linear probing or double-hashing to handle collisions when inserting.
• hasKey(), get() and remove() will need to use the same approach since
they also need to find the right item.
It’s probably a good idea to try make a private find() method that does
the probing for these three functions and returns the index to use. Use the
DSAHashEntry state to tell you when to stop probing.
• Be aware that remove() with probing methods adds the problem that it
can break probing unless additional measures are taken.
– In particular, say we added Key1, then Key2 which collides with
Key1, so we linearly probe and add Key2 to the next entry.
If we remove Key1, later attempts to get Key2 will fail because Key2
maps to where Key1 used to be.
Since it is now null, probing will abort and imply that Key2 doesn’t
exist.
– The solution is to use the 00301J 、Java state filed in DSAHashEntry that tracks
whether the entry has been used before or not.

2. Resizing a Hash Table
Modify your DSAHashTable to allow it to resize. There are various ways to determine
when to and how to resize a hash table.

The simplest way to determine when is to set an upper and lower threshold value
for the load factor. When the number of elements is outside of this, the put() or
remove() methods should call resize(size) automatically.
• Remember, this will be computationally expensive (what is it it in Big-O?), so it is
important not to set the threshold too low. Also, collisions occur more frequently
at higher load factors, thus it is equally important to not set the threshold too
high. Do some research to find "good" values.
A simple way to resize is to create a new array, then iterate over hashArray (ignoring
unused and previously used slots) and re-hashing (using put().
• To select a suitable size for the new array, you can either use a "look up" table of
suitable primes or re-calculate a new prime after doubling/halving the previous
size.
Test your resize functionality with a small hash table size, just so you know it will
work when you increase the size of the table. Data Structures and Algorithms Hash Tables
CRICOS Provide Code: 00301J Page 3 of 3


3. File I/O
To truly test your hash table implementation, you will need a large dataset. Read in
the RandomNames7000.csv as input to insert values into your hash table. There are some
duplicates in the file, so your program should be able to handle them.

It is also useful to be able to save the hash table. The save order is not important,
so just iterate through the keys and values in the order they are stored in the hash
table and write it to a .csv.

Submission Deliverable
• Your code are due 2 weeks from your current tutorial session.
– You will demonstrate your work to your tutors during that session
– If you have completed the practical earlier, you can demonstrate your work
during the next session
• You must submit your code and any test data that you have been using electronically
via Blackboard under the Assessments section before your demonstration.
– Java students, please do not submit the *.class files

Marking Guide
Your submission will be marked as follows:
• [6] Your DSAHashTable and DSAHashEntry are implemented correctly.
• [4] Your hash function is well thought out and properly implemented.
This means that it meets at least the first three criteria of a good hash function and
you can argue that it at least partially meets the last.
• [5] Your hash table resizes as you put and remove hash entries.
• [5] You can read in and save .csv files         

自动驾驶小车DIY:树莓派+激光雷达实现DWA路径规划(从仿真到实车) 本文详细介绍了如何基于树莓派与激光雷达,从零搭建一套完整的自动驾驶小车系统,并实现DWA局部路径规划算法。内容涵盖硬件选型、ROS环境部署、DWA算法原理与仿真,以及关键的实车调试与性能优化技巧,为创客和竞赛爱好者提供了一套低成本、高可行性的自主导航解决方案。 阅读详情

相关推荐

波克 上海 Unity开发笔试题 2024

主要分为四部分,如果没有准备好,不要点击笔试链接,进入就会自动开始。

z2014z的博客 3394

00301J Data Structures and Algorithms Hash Tables

Note:right key.hashArray.July, 2023AimsActivitiesgNote:keys.exist.size.

WX_codehelp的博客 1036

通义灵码+高德 MCP:40分钟开发出游攻略网站

本文介绍了通义灵码与高德MCP在40分钟内快速开发出游攻略网站的全流程。主要内容包括:1)LingmaIDE开发环境的使用方法,涵盖界面操作、代码编辑、调试和智能编码功能;2)通义灵码智能体与高德MCP2.0的集成步骤,通过输入旅行需求即可自动生成包含天气卡片、景点路线等元素的HTML页面;3)重点展示了如何将行程规划导入高德地图APP,实现导航、打车等出行功能。整个开发过程充分利用了通义灵码的智能编码能力和高德地图的服务接口,显著提升了旅游类应用的开发效率。

soso1968的博客 986

【Java程序设计】【C00301】基于Springboot的社区物资交易互助平台(有论文)

这是一个基于Springboot的社区物资交易互助平台,本系统有管理员以及用户角色权限;

mataodehtml的博客 423

CAPL通过SecMgrCANoeClient.dll实现AES 128

需要加载SecMgrCANoeClient.dll这个动态库,可以在canoe安装路径下Exec32这个文件夹里找。这个库不是哪版canoe都带,canoe15就没有,11,14是有的。我需要用到的是AES 128 ECB nopadding,这里函数介绍说是padding mode PKCS5,但是最后算出的结果是我可以使用的。CAPL中可以使用下列函数实现AES 128的算法。需要注意输入输出字节的长度。

天赐好车的博客 4931

Centos7 yum 报错「Errno 256」No more mirrors to try 解决方法

首先该问题的出现是由于网络的震荡导致,这是重点。(1)将源更换成阿里云的官方源,步骤参考如上(2)同时将zabbix的官方源更换成阿里云里面的zabbix镜像源,因为zabbix官方源根本网络不通,因为国家防火墙的拦截,导致网络不通。这是阿里源的zabbix镜像地址: https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/修改系统中早期生成的zabbix.repo文件,如下:主要是把baseurl替换成阿里云的zabbix镜像地址即可。

专注基础架构领域 3874

CRICOS Java

Note:TreesAimsActivities。

qq___99515681的博客 503

Allegro如何进行四层板板层设计

板层的设计

weixin_42499230的博客 3189

Java 数据科学(三)

虽然神经网络已经存在了很多年,但由于改进的算法和更强大的机器,它们变得越来越受欢迎。一些公司正在构建明确模仿神经网络的硬件系统(https://www.wired.com/2016/05/google-tpu-custom-chips/)。使用这种多功能技术来解决数据科学问题的时候到了。在这一章中,我们将探索神经网络背后的思想和概念,然后演示它们的使用。具体来说,我们将:定义并举例说明神经网络描述他们是如何被训练的检查各种神经网络架构Discuss and demonstrate several diffe

龙哥盟 1090

Spring AI Alibaba实战训练营-14基于A2A协议智能体应用开发指南

本文介绍了基于A2A协议的智能体应用开发流程,主要包括客户端和服务端两个模块的实现。关键技术包括A2A通信协议、Nacos服务发现、Spring AI Alibaba框架和DashScope通义千问API。开发步骤涵盖环境准备(JDK17、Maven、Nacos)、项目创建、依赖配置(重点引入spring-ai-alibaba相关组件)以及Nacos和DashScope的核心配置。整个系统架构采用客户端通过Nacos发现服务端Agent,再调用阿里云AI服务的模式,实现了AI能力的解耦与复用。

program哲学 505

图文:银行核心账务处理逻辑(白话篇)

银行账务系统分为对内账(记录银行自身资产负债)和对外账(处理客户交易),通过特定编码规则的账号体系进行管理。采用T型账户结构和凭证制度确保每笔交易可追溯,通过明细核算与综合核算双线并行、每日轧账核对(科目日结单、总账、日计表)实现账务精准平衡。从业务触发到最终账平的全流程体现了银行账务"分层记录、双向核对、闭环校验"的核心原则,保障资金流动的透明性与安全性。

银行信息系统应用架构详解 540

web service 异常

1.org/apache/commons/discovery/tools/DiscoverSingleton Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/discovery/tools/DiscoverSingleton 缺少:commons-logging和commons-di

DING135DING的专栏 647

ardupilot 获取避障传感器数据

本节主要记录自己学ardupilot的避障代码过程,首先看下怎么注册避障传感器,然后怎么获取避障数据。

陌城烟雨 5524

调用Axis WebService服务端错误的解决

错误信息: AxisFault faultCode:{http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString:java.lang.reflect.InvocationTargetException faultActor: faultNode: faultDe

chachastone2016的博客 4946

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

InnoDB 内存结构总览:Change Buffer、AHI 与 Log Buffer

本文系统梳理InnoDB内存结构中的ChangeBuffer、Adaptive Hash Index(AHI)与LogBuffer。ChangeBuffer缓存二级索引页不在内存时的变更,减少随机IO,仅在页加载时合并;聚簇索引修改立即执行,因数据本身不可延后。AHI基于高频等值查询自动构建哈希索引,加速定位,仅支持等值操作。LogBuffer为redo log内存缓冲,配合磁盘日志实现崩溃恢复。三者均服务于性能优化,其中ChangeBuffer与AHI共享BufferPool空间,而LogBuffer独立

bksczm的博客 285

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

V8 机制、手写核心函数与 TypeScript 类型体操

或固定初始化(如数组先定长、对象先给全字段)保持类型与形状稳定;这些都比"换框架"更基础。只能处理纯数据(丢函数、Date、RegExp、循环引用报错)。生产级深拷贝要处理:原始值短路、循环引用、V8(Chrome / Node 的 JS 引擎)不是"解释一行跑一行"那么简单,它用。图:V8 执行流程——解释执行 + 热点优化,优化失败会 Deopt 回退。JS 内存自动管理,但"自动"不等于"不会漏"。是"固定间隔最多执行一次"。手写 Promise 是"懂异步"的试金石。是"停下后才执行最后一次",

qq_38468358的博客 346

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Spring Boot 数据源与 MyBatis(-Plus) 自定义配置详解

本文详解 Spring Boot 中单数据源环境下 HikariCP 与 MyBatis-Plus 的自定义配置。通过手动声明 SqlSessionFactory,实现下划线转驼峰、日志输出、一级缓存策略等精细化控制。结合 HikariCP 核心参数调优(如最大连接数、连接生命周期),确保高性能与稳定性。适用于仅需访问单一数据库的场景,避免多数据源复杂性,兼顾性能与可维护性。

BADAO_LIUMANG_QIZHI的博客 198

Java EE 进阶:8.MyBatis 操作数据库(入门)(第一弹)

Java EE 进阶:8.MyBatis 操作数据库(入门)(第一弹)

要努力去发光,而不是被照亮~ 128

LeetCode Hot 100 二叉树专题(二)3 题(Java)

本篇文章共 3 题:543. 二叉树的直径、102. 二叉树的层序遍历、108. 将有序数组转换为二叉搜索树。 每道题都统一按「① 题目分析 & 解题思路 → ② 常见解法(附代码)及讲解 → ③ 知识点总结」的顺序组织;代码使用 Java 编写,节点定义沿用 LeetCode 默认的 TreeNode。

2401_88612756的博客 365

【从零理解 Spring AI · 12】MCP 的两种角色:做客户端还是做服务端

上一篇讲了 MCP 的概念:标准协议、三大角色、M+N 替代 M×N。

nice_lcj520的博客 498

JDK 下载安装:装完 Java 提示「不是内部或外部命令」?环境变量没配

JDK 是写 Java 程序必须装的东西。它包含运行 Java 的虚拟机(JRE)和编译 Java 的编译器(javac)——装了它,能跑、.java文件能编译成可执行程序。免费,学习和小规模生产都不花钱。

科小怪的博客 633

java框架大全

java框架大全

qq_39326137的博客 183

Java 多态 学习笔记

多态是面向对象编程的重要特性,指同一操作作用于不同对象时产生不同行为。其核心在于“父类引用指向子类对象”,结合方法重写实现运行时动态绑定。多态使代码更灵活、可扩展,如用Person p = new Student();统一处理各类人员注册,无需修改调用逻辑。但多态无法直接调用子类特有方法,需通过instanceof判断并强制转换。编译时看左边(类型),运行时看右边(实际对象),实现解耦与维护便利。

AA_AA114514的博客 360

SecureRandom做随机源,这个Java随机字符串工具类有3个方法

本文分享一款JDK17环境下的Java随机字符串工具类,内置3个开箱即用的方法,全部采用SecureRandom加密安全随机源,不存在弱随机、可预测、取模偏差等问题。工具类支持默认62字符集随机串、纯数字随机串、自定义字符集随机串三种生成模式,支持Unicode码点级别的字符集处理,兼容Emoji等增补字符,边界处理严格,异常信息明确,适合验证码、邀请码、盐值、随机口令、短链码等场景,源码可直接复制使用。

Java后端 | AI智能体应用实战派 | 电脑技能行家 298

IDEA 简介:从零认识 IntelliJ IDEA

IDEA 全称,是由 JetBrains 公司开发的一款主流 Java 集成开发环境(IDE)。它集代码编辑、编译、调试、测试、版本控制、构建管理等功能于一体,被大量 Java 开发者视为日常开发的首选工具。所谓 IDE(Integrated Development Environment,集成开发环境),就是把写代码所需的各类工具整合到同一个界面中。相比只用文本编辑器加命令行编译,IDE 能显著减少重复操作,让开发者把精力集中在业务逻辑上。

ztI10的博客 151

Java实现批量线段相交检测(跨积判定+扫描线优化与踩坑复盘)

【代码】Java实现批量线段相交检测(跨积判定+扫描线优化与踩坑复盘)

m0_64476639的博客 328
上一篇: CITS2002 C/C++
下一篇: program c/c++,Python
rainingruning
博客等级 码龄2年 240粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值