leetcode 2619 11

11.3

2、从键盘上输入10个整数,并放入一个一维数组中,然后将其逆序重新存放。即:第1个元素和第10个元素互换,第2个元素和第9个元素互换……分别输出数组原来的值和兑换后各元素的值。 程序代码: #include <stdio.h> int main() { int arr[10]; int i, tem ......
11.3 11

11.6

3、计算一个4×4矩阵两个对角线之和。 程序代码: #include <stdio.h> int main() { int matrix[4][4]; int i, j, sum_main_diagonal = 0, sum_secondary_diagonal = 0; printf("请输入4× ......
11.6 11

11.7

4、编写将n个数从小到大排序的函数,要求该函数返回排序过程中交换的次数,并设计main函数,验证算法正确与否。 int sort( int arr[], int n) {……….} 程序代码: 程序代码: #include <stdio.h> int sort(int array[], int n) ......
11.7 11

11.9

5、随机产生20个[45,210]范围内的正整数,实现以下功能: a) 求最大值、最小值和平均值。 b) 求小于平均值的数据的个数。 提示:产生随机数使用库函数:rand();下面两条语句用于系统随机生成45~210之间的整数: srand(time(NULL)); /*初始化随机因子*/ for( ......
11.9 11

11.10

6、输入10个学生5门课的成绩,分别用函数实现下列功能:(选做) (1) 计算每个学生的平均分。 (2) 计算每门课的平均分。 (3) 找出所有50个分数中最高的分数所对应的学生和课程; (4) 计算平均分方差: ,其中,xi为某一个学生的平均分。 程序代码: #include <stdio.h> ......
11.10 11 10

11.13

2. 用一个函数实现两个字符串的比较,即自己写一个strcmp函数,函数原型为 int strcmp(char *p1,char *p2); 设p1指向字符串s1,p2指向字符串s2,要求当s1=s2时,函数返回值为0;如果s1≠s2,返回它们二者第一个不相同字符的ASCII码差值(如“BOY”与“ ......
11.13 11 13

11.14

3. 编写一个程序,将字符数组s2中的全部字符复制到字符数组s1中。不用strcpy函数。复制时’\0’也要复制过去,’\0’后面的字符不复制。 程序代码: #include <stdio.h> void copyString(char s1[], char s2[]) { int i = 0; w ......
11.14 11 14

[LeetCode] LeetCode373. 查找和最小的K对数字

题目描述 思路:大顶堆+翻转 注意:该题有问题,代码可以通过测试用例。 方法一: class Solution { public List<List<Integer>> kSmallestPairs(int[] nums1, int[] nums2, int k) { PriorityQueue<N ......
LeetCode 数字 373

11.1

public class UserServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletExceptio ......
11.1 11

助教工作11月总结(前端开发技术)

一、助教工作的具体职责和任务 作为前端课程的助教,主要职责是协助老师完成一些课外的教学任务,具体包括但不限于以下内容: 解答学生提出的问题:通过QQ群、邮件等方式与学生进行沟通,帮助他们解决在学习过程中遇到的问题和困惑。提供适当的指导和建议,引导学生找到解决问题的方法和思路。 推荐优秀资源:推荐一些 ......
前端 开发技术 技术

[LeetCode138-链表-中等] 复制带有随机指针的链表

这道题是这样的,就是说有一个链表LindedNode, 通常我们链表包含2个属性,一个是它的值val,另一个是它指向的下一个结点nextNode, 但是这个题目中的链表还有一个属性,就是它还有个随机指针,这个随机指针可能指向链表中的任意结点(包括链表的结尾null结点,或者是自己) 也就是说这个链表 ......
指针 LeetCode 138

[LeetCode] LeetCode692. 前K个高频单词

题目描述 思路 注意是前K个高频单词,就是TopK问题,只能用小根堆找最大的K个元素啊,用大根堆找的就是最小的K个元素了 思路一: class Solution { public List<String> topKFrequent(String[] words, int k) { Map<Strin ......
LeetCode 单词 692

[LeetCode] LeetCode378. 有序矩阵中第K小的元素

题目描述 思路:Top-K问题 + 大顶堆 使用大顶堆求第K小的元素。 方法一: class Solution { public int kthSmallest(int[][] matrix, int k) { // 1. 使用大顶堆 PriorityQueue<Integer> heap = ne ......
LeetCode 矩阵 元素 378

[LeetCode] 2415. Reverse Odd Levels of Binary Tree

Given the root of a perfect binary tree, reverse the node values at each odd level of the tree. For example, suppose the node values at level 3 are [2 ......
LeetCode Reverse Binary Levels 2415

代码随想录算法训练营第天|LeetCode203.移除链表元素707.设计链表206.反转链表

LeetCode203.移除链表元素 ● 今日学习的文章链接和视频链接 代码随想录 (programmercarl.com) 题目链接 203. 移除链表元素 - 力扣(LeetCode) ● 自己看到题目的第一想法 之前做这道题时想的不是很清楚,浅看了一下代码随想录的思路,又重新写了一边。删除链表 ......
随想录 训练营 随想 算法 LeetCode

11.24

今日学习内容 document.getElementById("login-form").addEventListener("submit", function (event) { event.preventDefault(); // 阻止表单默认提交行为 var username = docume ......
11.24 11 24

11.23

今日学习内容 <%@ page import="java.sql.DriverManager" %><%@ page import="java.sql.*" %><%-- Created by IntelliJ IDEA. To change this template use File | Set ......
11.23 11 23

11.8

今日学习内容 <%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" ......
11.8 11

11.9

今日学习内容 <%@ page import="java.sql.*" %><%@ page import="java.sql.DriverManager" %><%-- Created by IntelliJ IDEA. To change this template use File | Set ......
11.9 11

11.10

今日学习内容 <%@ page contentType="text/html;charset=UTF-8" language="java" %><html><head> <title>更改密码</title></head><body><h1>更改密码</h1><hr><form action="su ......
11.10 11 10

11.15

今日学习内容 <%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" ......
11.15 11 15

11.16

今日学习内容 <%@ page import="java.sql.DriverManager" %><%@ page import="java.sql.*" %><%-- Created by IntelliJ IDEA. To change this template use File | Set ......
11.16 11 16

11.17

今日学习内容 <%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" ......
11.17 11 17

11.20

今日学习内容 <%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" ......
11.20 11 20

11.21

今日学习内容 <%@ page import="java.sql.*" %><%@ page import="java.sql.DriverManager" %><%-- Created by IntelliJ IDEA. To change this template use File | Set ......
11.21 11 21

11.22

今日学习内容 <%@ page import="java.sql.*" %><%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page content ......
11.22 11 22

11.1

今日学习内容 <%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" ......
11.1 11

11.2

今日学习内容 <%@ page import="java.sql.*" %><%@ page import="java.sql.DriverManager" %><%-- Created by IntelliJ IDEA. To change this template use File | Set ......
11.2 11

11.3

今日学习内容 <%-- Created by IntelliJ IDEA. To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" ......
11.3 11

11.4

今日学习内容 <%@ page import="java.sql.*" %><%@ page import="java.sql.DriverManager" %><%-- Created by IntelliJ IDEA. To change this template use File | Set ......
11.4 11