List基礎與難度題

1. 向?ArrayList?中添加元素并打印

  • 功能描述
    • 程序創建一個空的?ArrayList?集合,用于存儲字符串類型的元素。
    • 向該?ArrayList?中依次添加指定的字符串元素。
    • 使用增強型?for?循環遍歷?ArrayList?中的所有元素,并將每個元素打印輸出到控制臺。
  • 測試數據描述
    • 預期向?ArrayList?中添加的字符串元素為?"apple""banana""cherry"
    • 預期控制臺輸出為:
import java.util.ArrayList;
import java.util.List;public class ArrayListAdd {public static void main(String[] args) {List fruit = new ArrayList();String fruit1 = "apple";String fruit2 = "banana";String fruit3 = "cherry";fruit.add(fruit1);fruit.add(fruit2);fruit.add(fruit3);for (Object fruitNum : fruit) {System.out.println(fruitNum);}}
}

2. 從?HashSet?中移除重復元素

  • 功能描述
    • 首先創建一個?ArrayList?并向其中添加包含重復元素的字符串。
    • 然后利用?HashSet?的特性(HashSet?不允許存儲重復元素),將?ArrayList?中的元素添加到?HashSet?中,自動去除重復元素。
    • 最后遍歷?HashSet?并將其中的元素打印到控制臺,驗證重復元素已被成功移除。
  • 測試數據描述
    • ArrayList?中添加的字符串元素為?"apple""banana""apple",其中?"apple"?為重復元素。
    • 預期?HashSet?中存儲的元素為?"apple""banana"(元素順序可能不同,因為?HashSet?是無序的)。
    • 預期控制臺輸出類似(元素順序不固定):

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;public class HashSetRemove {public static void main(String[] args) {List fruit = new ArrayList();String fruit1 = "apple";String fruit2 = "banana";String fruit3 = "apple";String fruit4 = "apple";fruit.add(fruit1);fruit.add(fruit2);fruit.add(fruit3);fruit.add(fruit4);for (Object fruitNum : fruit) {System.out.println(fruitNum);}System.out.println("====================");Set fruitNew = new HashSet();for (Object fruitNum : fruit) {fruitNew.add(fruitNum);}System.out.println(fruitNew);}
}

3. 使用?HashMap?統計單詞出現次數

  • 功能描述
    • 給定一個字符串數組,程序創建一個?HashMap?用于統計每個單詞在數組中出現的次數。
    • 遍歷字符串數組,對于每個單詞,在?HashMap?中檢查該單詞是否已存在。如果存在,則將其對應的值加 1;如果不存在,則將該單詞作為鍵,值設為 1 存入?HashMap
    • 最后遍歷?HashMap?的鍵值對,將每個單詞及其出現的次數打印到控制臺。
  • 測試數據描述
    • 給定的字符串數組為?{"apple", "banana", "apple", "cherry", "banana", "apple"}
    • 預期?HashMap?中的統計結果為:"apple" -> 3"banana" -> 2"cherry" -> 1
    • 預期控制臺輸出類似(順序不固定):
import java.util.HashMap;
import java.util.Map;public class HashMap_collection {public static void main(String[] args) {String [] fruits = {"apple", "banana", "apple", "cherry", "banana", "apple"};Map<String,Integer> fruitMap = new HashMap<>();for (String fruit : fruits) {if (fruitMap.containsKey(fruit)) {// 如果單詞已存在于 HashMap 中,將其對應的值加 1fruitMap.put(fruit, fruitMap.get(fruit) + 1);} else {// 如果單詞不存在于 HashMap 中,將該單詞作為鍵,值設為 1 存入 HashMapfruitMap.put(fruit, 1);}}//        int j = 0;
//        int k = 0;
//        int z = 0;
//        for (int i=0; i < fruit.length; i++) {
//            if (fruit[i].equals("apple")){
//                fruitMap.put("apple",j+=1);
//            }else if (fruit[i].equals("banana")){
//                fruitMap.put("banana",k+=1);
//            }else if (fruit[i].equals("cherry")){
//                fruitMap.put("cherry",z+=1);
//            }
//        }System.out.println(fruitMap);}
}

?

4. 合并兩個?HashMap

  • 功能描述
    • 分別創建兩個?HashMap,用于存儲字符串類型的鍵和整數類型的值。
    • 將第一個?HashMap?的內容復制到一個新的?HashMap?中作為合并的基礎。
    • 遍歷第二個?HashMap?的鍵值對,對于每個鍵,如果在新的?HashMap?中已存在該鍵,則將對應的值相加;如果不存在,則將該鍵值對直接存入新的?HashMap
    • 最后遍歷合并后的?HashMap,將每個鍵及其對應的值打印到控制臺。
  • 測試數據描述
    • 第一個?HashMapmap1)的鍵值對為?{"apple" -> 3, "banana" -> 2}
    • 第二個?HashMapmap2)的鍵值對為?{"apple" -> 2, "cherry" -> 1}
    • 預期合并后的?HashMap?鍵值對為?{"apple" -> 5, "banana" -> 2, "cherry" -> 1}
    • 預期控制臺輸出類似(順序不固定):
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;public class HashMap_combine {public static void main(String[] args) {Map<String,Integer> fruitMap1 = new HashMap<>();Map<String,Integer> fruitMap2 = new HashMap<>();Map<String,Integer> fruitMap3 = new HashMap<>();fruitMap1.put("apple",3);fruitMap1.put("banana",2);fruitMap2.put("apple",2);fruitMap2.put("cherry",1);Iterator it = fruitMap1.keySet().iterator();while(it.hasNext()){String fruitKey = (String) it.next();fruitMap3.put(fruitKey,fruitMap1.get(fruitKey));}System.out.println("map1:"+fruitMap1);System.out.println("map2:"+fruitMap2);System.out.println("map3:"+fruitMap3);Iterator it1 = fruitMap2.keySet().iterator();while(it1.hasNext()){String fruitKey1 = (String) it1.next();if (fruitMap3.containsKey(fruitKey1)){fruitMap3.put(fruitKey1,fruitMap3.get(fruitKey1)+fruitMap2.get(fruitKey1));}else {fruitMap3.put(fruitKey1, fruitMap2.get(fruitKey1));}}System.out.println(fruitMap3);}}

?

5. 實現一個簡單的圖書管理系統

  • 功能描述
    • 定義一個?Book?類,用于表示圖書,包含圖書的標題和作者屬性。
    • 定義一個?Library?類,包含一個用于存儲?Book?對象的?ArrayListLibrary?類提供以下方法:
      • addBook(Book book):向圖書館的圖書列表中添加一本圖書。
      • removeBook(Book book):從圖書館的圖書列表中移除一本圖書。
      • findBook(String title):根據圖書標題在圖書館的圖書列表中查找圖書,如果找到則返回對應的?Book?對象,否則返回?null
      • displayAllBooks():遍歷圖書館的圖書列表,將每本圖書的信息(標題和作者)打印到控制臺。
    • 在?LibrarySystem?類的?main?方法中,進行以下操作:
      • 創建一個?Library?對象。
      • 向圖書館中添加幾本圖書。
      • 顯示圖書館中所有的圖書信息。
      • 根據圖書標題查找一本圖書,并顯示查找結果。
      • 從圖書館中移除找到的圖書,然后再次顯示圖書館中所有的圖書信息,驗證圖書已被成功移除。
  • 測試數據描述
    • 預期添加到圖書館的圖書為:
      • 第一本圖書:標題為?"Java Programming",作者為?"John Doe"
      • 第二本圖書:標題為?"Python Crash Course",作者為?"Jane Smith"
    • 預期第一次顯示所有圖書時,控制臺輸出為:
Title: Java Programming, Author: John Doe
Title: Python Crash Course, Author: Jane Smith
  • 預期查找圖書?"Java Programming"?時,能找到對應的?Book?對象。
  • 預期移除找到的圖書后,再次顯示所有圖書時,控制臺輸出為:
Title: Python Crash Course, Author: Jane Smith

?Book類

public class Book {private String title;private String Author;public Book() {}public Book(String title, String author) {this.title=title;Author=author;}public String getTitle() {return title;}public void setTitle(String title) {this.title=title;}public String getAuthor() {return Author;}public void setAuthor(String author) {Author=author;}
}

Library類

import java.util.ArrayList;
import java.util.HashMap;public class Library {//ArrayListprivate ArrayList<Book> books;public Library() {this.books = new ArrayList<>();}public void addBook(Book book){books.add(book);}public void removeBook(Book book){books.remove(book);}public Book findBook(String title){for (Book book : books) {if (book.getTitle().equals(title)){return book;}}return null;}public void displayAllBooks(){for (Book book : books) {System.out.println("Title:"+book.getTitle()+",Author:"+book.getAuthor());}}//    //HashMap
//    private HashMap<String, Book> books;
//
//    public Library() {
//        this.books = new HashMap<>();
//    }
//
//    public void addBook(Book book) {
//        books.put(book.getTitle(), book);
//    }
//
//    public void removeBook(Book book) {
//        books.remove(book.getTitle());
//    }
//
//    public Book findBook(String title) {
//        return books.get(title);
//    }
//
//    public void displayAllBooks() {
//        for (Book book : books.values()) {
//            System.out.println(book);
//        }
//    }
}

Test類

public class test {public static void main(String[] args) {Library library = new Library();Book book1 = new Book("Java Programming", "John Doe");Book book2 = new Book("Python Crash Course", "Jane Smith");library.addBook(book1);library.addBook(book2);System.out.println("所有圖書信息:");library.displayAllBooks();Book foundBook = library.findBook("Java Programming");if (foundBook != null) {System.out.println("找到圖書:Title: " + foundBook.getTitle() + ", Author: " + foundBook.getAuthor());} else {System.out.println("未找到該圖書。");}System.out.println("\n移除找到的書籍");library.removeBook(foundBook);System.out.println("\n移除圖書后所有圖書信息:");library.displayAllBooks();}
}

難度題目

在線商城訂單管理系統

功能描述

此在線商城訂單管理系統是一個較為復雜的面向對象程序,用于模擬在線商城的訂單管理流程,包含了商品、用戶、購物車、訂單等核心概念。以下是各個類的詳細功能:

1.?Product?
  • 屬性
    • productId:商品的唯一標識符,類型為?String
    • name:商品的名稱,類型為?String
    • price:商品的單價,類型為?double
    • stock:商品的庫存數量,類型為?int
  • 方法
    • 構造方法:用于初始化商品的基本信息。
    • getProductId():獲取商品的唯一標識符。
    • getName():獲取商品的名稱。
    • getPrice():獲取商品的單價。
    • getStock():獲取商品的庫存數量。
    • decreaseStock(int quantity):減少商品的庫存數量,當減少的數量大于當前庫存時,拋出異常。
    • increaseStock(int quantity):增加商品的庫存數量。
2.?User?
  • 屬性
    • userId:用戶的唯一標識符,類型為?String
    • name:用戶的姓名,類型為?String
    • shoppingCart:用戶的購物車,類型為?ShoppingCart
    • orders:用戶的訂單列表,類型為?List<Order>
  • 方法
    • 構造方法:用于初始化用戶的基本信息,并創建一個空的購物車和訂單列表。
    • getUserId():獲取用戶的唯一標識符。
    • getName():獲取用戶的姓名。
    • getShoppingCart():獲取用戶的購物車。
    • getOrders():獲取用戶的訂單列表。
    • addOrder(Order order):將一個新的訂單添加到用戶的訂單列表中。
3.?ShoppingCart?
  • 屬性
    • items:購物車中的商品項列表,類型為?List<CartItem>
  • 方法
    • 構造方法:用于創建一個空的購物車。
    • addItem(Product product, int quantity):向購物車中添加一個商品項,如果商品已存在,則增加其數量;如果商品不存在,則創建一個新的商品項。
    • removeItem(Product product):從購物車中移除指定的商品項。
    • updateQuantity(Product product, int newQuantity):更新購物車中指定商品項的數量。
    • getTotalPrice():計算購物車中所有商品項的總價。
    • clear():清空購物車中的所有商品項。
4.?CartItem?
  • 屬性
    • product:購物車中的商品,類型為?Product
    • quantity:商品的數量,類型為?int
  • 方法
    • 構造方法:用于初始化購物車中的商品項。
    • getProduct():獲取購物車中的商品。
    • getQuantity():獲取商品的數量。
    • getTotalPrice():計算該商品項的總價。
5.?Order?
  • 屬性
    • orderId:訂單的唯一標識符,類型為?String
    • user:下單的用戶,類型為?User
    • items:訂單中的商品項列表,類型為?List<CartItem>
    • orderStatus:訂單的狀態,類型為?String(如 "待支付"、"已支付"、"已發貨" 等)。
  • 方法
    • 構造方法:用于初始化訂單的基本信息。
    • getOrderId():獲取訂單的唯一標識符。
    • getUser():獲取下單的用戶。
    • getItems():獲取訂單中的商品項列表。
    • getOrderStatus():獲取訂單的狀態。
    • setOrderStatus(String status):設置訂單的狀態。
    • getTotalPrice():計算訂單中所有商品項的總價。
6.?OnlineMall?
  • 屬性
    • products:商城中的商品列表,類型為?List<Product>
    • users:商城的用戶列表,類型為?List<User>
  • 方法
    • 構造方法:用于創建一個空的商城,包含空的商品列表和用戶列表。
    • addProduct(Product product):向商城中添加一個新的商品。
    • addUser(User user):向商城中添加一個新的用戶。
    • processOrder(User user):處理用戶的訂單,包括創建訂單、減少商品庫存、清空購物車等操作。

測試數據描述
  • 商品數據
    • 筆記本電腦:商品編號?"P001",名稱?"筆記本電腦",單價?5000?元,庫存?10?件。
    • 手機:商品編號?"P002",名稱?"手機",單價?3000?元,庫存?20?件。
  • 用戶數據
    • 用戶?"張三":用戶編號?"U001"
  • 購物車數據
    • 用戶?"張三"?的購物車中添加?1?臺筆記本電腦和?2?部手機。
  • 預期結果
    • 生成一個新的訂單,訂單編號為以?"O"?開頭并包含當前時間戳的字符串。
    • 訂單總價為?1 * 5000 + 2 * 3000 = 11000?元。
    • 訂單狀態初始為?"待支付"
    • 筆記本電腦的庫存減少為?9?件,手機的庫存減少為?18?件。
    • 用戶?"張三"?的購物車被清空。

Product類

public class Product {private String productId;private String name;private double price;private int stock;public Product(String productId, String name, double price, int stock) {this.productId = productId;this.name = name;this.price = price;this.stock = stock;}public String getProductId() {return productId;}public String getName() {return name;}public double getPrice() {return price;}public int getStock() {return stock;}public void decreaseStock(int quantity) {if (quantity > stock) {throw new IllegalArgumentException("庫存不足");}stock -= quantity;}public void increaseStock(int quantity) {stock += quantity;}
}

User類

import java.util.ArrayList;
import java.util.List;public class User {private String userId;private String name;private ShoppingCart shoppingCart;private List<Order> orders;public User(String userId, String name) {this.userId = userId;this.name = name;this.shoppingCart = new ShoppingCart();this.orders = new ArrayList<>();}public String getUserId() {return userId;}public String getName() {return name;}public ShoppingCart getShoppingCart() {return shoppingCart;}public List<Order> getOrders() {return orders;}public void addOrder(Order order) {orders.add(order);}
}

ShoppingCart類

import java.util.ArrayList;
import java.util.List;public class ShoppingCart {private List<CartItem> items;public ShoppingCart() {this.items = new ArrayList<>();}public void addItem(Product product, int quantity) {for (CartItem item : items) {if (item.getProduct().getProductId().equals(product.getProductId())) {item.setQuantity(item.getQuantity() + quantity);return;}}items.add(new CartItem(product, quantity));}public void removeItem(Product product) {items.removeIf(item -> item.getProduct().getProductId().equals(product.getProductId()));}public void updateQuantity(Product product, int newQuantity) {for (CartItem item : items) {if (item.getProduct().getProductId().equals(product.getProductId())) {item.setQuantity(newQuantity);return;}}}public double getTotalPrice() {double total = 0;for (CartItem item : items) {total += item.getTotalPrice();}return total;}public void clear() {items.clear();}public List<CartItem> getItems() {return items;}
}

CartItem類

public class CartItem {private Product product;private int quantity;public CartItem(Product product, int quantity) {this.product=product;this.quantity=quantity;}public Product getProduct() {return product;}public int getQuantity() {return quantity;}public void setQuantity(int quantity) {this.quantity=quantity;}public double getTotalPrice() {return product.getPrice() * quantity;}
}

Order類

public class Order {private String orderId;private User user;private List<CartItem> items;private String orderStatus;public Order(String orderId, User user, List<CartItem> items, String orderStatus) {this.orderId = orderId;this.user = user;this.items = items;this.orderStatus = orderStatus;}public String getOrderId() {return orderId;}public User getUser() {return user;}public List<CartItem> getItems() {return items;}public String getOrderStatus() {return orderStatus;}public void setOrderStatus(String status) {this.orderStatus = status;}public double getTotalPrice() {double total = 0;for (CartItem item : items) {total += item.getTotalPrice();}return total;}
}

OnlineMall類

import java.util.ArrayList;
import java.util.List;public class OnlineMall {private List<Product> products;private List<User> users;public OnlineMall() {this.products = new ArrayList<>();this.users = new ArrayList<>();}public void addProduct(Product product) {products.add(product);}public void addUser(User user) {users.add(user);}public void processOrder(User user) throws Exception {ShoppingCart cart = user.getShoppingCart();List<CartItem> items = new ArrayList<>(cart.getItems());for (CartItem item : items) {Product product = item.getProduct();product.decreaseStock(item.getQuantity());}String orderId = "O" + System.currentTimeMillis();Order order = new Order(orderId, user, items, "待支付");user.addOrder(order);cart.clear();}
}

Test類

public class test {public static void main(String[] args) throws Exception {OnlineMall mall = new OnlineMall();Product laptop = new Product("P001", "筆記本電腦", 5000, 10);Product phone = new Product("P002", "手機", 3000, 20);mall.addProduct(laptop);mall.addProduct(phone);User zhangsan = new User("U001", "張三");mall.addUser(zhangsan);ShoppingCart cart = zhangsan.getShoppingCart();cart.addItem(laptop, 1);cart.addItem(phone, 2);mall.processOrder(zhangsan);System.out.println("訂單編號: " + zhangsan.getOrders().get(0).getOrderId());System.out.println("訂單總價: " + zhangsan.getOrders().get(0).getTotalPrice());System.out.println("訂單狀態: " + zhangsan.getOrders().get(0).getOrderStatus());System.out.println("筆記本電腦庫存: " + laptop.getStock());System.out.println("手機庫存: " + phone.getStock());System.out.println("購物車是否為空: " + zhangsan.getShoppingCart().getItems().isEmpty());}
}

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/76062.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/76062.shtml
英文地址,請注明出處:http://en.pswp.cn/web/76062.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

樓宇自控系統如何為現代建筑打造安全、舒適、節能方案

在科技飛速發展的當下&#xff0c;現代建筑對功能和品質的要求日益提升。樓宇自控系統作為建筑智能化的核心技術&#xff0c;宛如一位智慧的“管家”&#xff0c;憑借先進的技術手段&#xff0c;為現代建筑精心打造安全、舒適、節能的全方位解決方案&#xff0c;讓建筑真正成為…

綠算輕舟系列FPGA加速卡:驅動數字化轉型的核心動力【2】

工業與醫療&#xff1a;精準化的幕后推手 在工業4.0與智慧醫療領域&#xff0c;綠算輕舟FPGA加速卡通過實時信號處理與高精度控制&#xff0c;推動關鍵場景的技術升級。 工業自動化&#xff1a;在機器視覺質檢中&#xff0c;實現亞像素級缺陷檢測&#xff0c;產線檢測速度大幅…

uniapp-商城-22-頂部模塊

這里其實很復雜.我們在前面已經說了這個組件 shop-headbar ,這里來繼續說。 該組件實現一個高度的顯示以及圖片展示,包含logo 名稱 后臺管理以及避讓 導航欄 和 手機的狀態欄。 1 整體 代碼如下: <template><view class="headr" :style="{ hei…

利用Global.asax在ASP.NET Web應用中實現功能

Global.asax文件&#xff08;也稱為ASP.NET應用程序文件&#xff09;是ASP.NET Web應用程序中的一個重要文件&#xff0c;它允許您處理應用程序級別和會話級別的事件。下面介紹如何利用Global.asax來實現各種功能。 Global.asax基本結構 <% Application Language"C#&…

ReportLab 導出 PDF(頁面布局)

ReportLab 導出 PDF&#xff08;文檔創建&#xff09; ReportLab 導出 PDF&#xff08;頁面布局&#xff09; ReportLab 導出 PDF&#xff08;圖文表格) PLATYPUS - 頁面布局和排版 1. 設計目標2. 開始3. Flowables3.1. Flowable.draw()3.2. Flowable.drawOn(canvas,x,y)3.3. F…

Ubuntu下安裝Intel MKL完整指南

&#x1f9e0; Intel MKL 安裝指南&#xff08;Ubuntu 完整版&#xff09; 適用平臺&#xff1a;Ubuntu 18.04 / 20.04 / 22.04 更新時間&#xff1a;2025 年最新版&#xff08;適配 Intel oneAPI 2024&#xff09; ? 一、安裝方式選擇 安裝方式適合用戶群體特點推薦程度&…

HackMyVM Gigachad.

Gigachad 信息搜集 ┌──(root?kali)-[/home/kali] └─# nmap 192.168.214.85 Starting Nmap 7.95 ( https://nmap.org ) at 2025-04-16 07:42 EDT Nmap scan report for 192.168.214.85 Host is up (0.00011s latency). Not shown: 997 closed tcp ports (reset) PORT S…

大模型全景解析:從技術突破到行業變革

目錄 一、引言&#xff1a;人工智能的新紀元 二、大模型發展歷史與技術演進 1. 早期探索期&#xff08;2015-2017&#xff09;&#xff1a;從"人工智障"到初具規模 RNN/LSTM架構時代&#xff08;2013-2017&#xff09; Transformer革命&#xff08;2017&#xf…

49、Spring Boot 詳細講義(六)(SpringBoot2.x整合Mybatis實現CURD操作和分頁查詢詳細項目文檔)

項目文檔:銀行借據信息CURD操作和分頁查詢 一、項目概述 1. 項目簡介 本項目旨在使用Spring Boot框架整合MyBatis連接Mysql數據庫實現借據信息的增加、刪除、修改和查詢功能,同時支持分頁查詢,并提供對應的Restful風格的接口。 2.環境準備 2.1.工具和軟件準備 JDK(建議…

youtube視頻和telegram視頻加載原理差異分析

1. 客戶側緩存與流式播放機制?? 流式視頻應用&#xff08;如 Netflix、YouTube&#xff09;通過??邊下載邊播放??實現流暢體驗&#xff0c;其核心依賴以下技術&#xff1a; ??緩存預加載??&#xff1a;客戶端在后臺持續下載視頻片段&#xff08;如 DASH/HLS 協議的…

把城市變成智能生命體,智慧城市的神奇進化

智能交通系統的建立與優化 智能交通系統&#xff08;ITS&#xff09;是智慧城市建設的核心部分之一&#xff0c;旨在提升交通管理效率和安全性。該系統利用傳感器網絡、GPS定位技術以及實時數據分析來監控和管理城市中的所有交通流動。例如&#xff0c;通過部署于道路兩側或交…

Oracle 23ai Vector Search 系列之5 向量索引(Vector Indexes)

文章目錄 Oracle 23ai Vector Search 系列之5 向量索引Oracle 23ai支持的向量索引類型內存中的鄰居圖向量索引 (In-Memory Neighbor Graph Vector Index)磁盤上的鄰居分區矢量索引 (Neighbor Partition Vector Index) 創建向量索引HNSW索引IVF索引 向量索引示例參考 Windows 環…

cas 5.3單點登錄中心開發手冊

文檔格式PDF 只讀文檔。 代碼源碼。 一、適用對象 需要快速上手出成果的服務端開發人員&#xff0c;具備3年經驗java 開發&#xff0c;熟悉數據庫&#xff0c;基本的Linux操作系統配置。 工期緊張需要快速搭建以cas為基礎的統一登錄中心&#xff0c;遇到技術瓶頸&#xff0c…

行星際激波在日球層中的傳播:Propagation of Interplanetary Shocks in the Heliosphere (第一部分)

行星際激波在日球層中的傳播&#xff1a;Propagation of Interplanetary Shocks in the Heliosphere &#xff08;第二部分&#xff09;- Chapter 3: Solar and heliospheric physics 行星際激波在日球層中的傳播&#xff1a;Propagation of Interplanetary Shocks in the Hel…

Linux——消息隊列

目錄 一、消息隊列的定義 二、相關函數 2.1 msgget 函數 2.2 msgsnd 函數 2.3 msgrcv 函數 2.4 msgctl 函數 三、消息隊列的操作 3.1 創建消息隊列 3.2 獲取消息隊列并發送消息 3.3 從消息隊列接收消息recv 四、 刪除消息隊列 4.1 ipcrm 4.2 msgctl函數 一、消息…

藍橋杯常考排序

1.逆序 Collections.reverseOrder() 方法對列表進行逆序排序。通過 Collections.sort() 方法配合 Collections.reverseOrder()&#xff0c;可以輕松實現從大到小的排序。 import java.util.ArrayList; // 導入 ArrayList 類&#xff0c;用于創建動態數組 import java.util.C…

ILGPU的核心功能使用詳解

什么是ILGPU? ILGPU 是一種用于高性能 GPU 程序的新型 JIT&#xff08;即時&#xff09;編譯器 &#xff08;也稱為 kernels&#xff09;編寫的 .基于 Net 的語言。ILGPU 完全 用 C# 編寫&#xff0c;沒有任何原生依賴項&#xff0c;允許您編寫 GPU 真正可移植的程序。…

金融的未來

1. DeFi的爆發式增長與核心使命 DeFi&#xff08;去中心化金融&#xff09;的使命是重構傳統金融基礎設施&#xff0c;通過區塊鏈技術實現更高的透明度、可訪問性、效率、便利性和互操作性。其增長數據印證了這一趨勢&#xff1a; TVL&#xff08;總鎖定價值&#xff09;爆炸…

在Vue項目中查詢所有版本號為 1.1.9 的依賴包名 的具體方法,支持 npm/yarn/pnpm 等主流工具

以下是 在Vue項目中查詢所有版本號為 1.1.9 的依賴包名 的具體方法&#xff0c;支持 npm/yarn/pnpm 等主流工具&#xff1a; 一、使用 npm 1. 直接過濾依賴樹 npm ls --depth0 | grep "1.1.9"說明&#xff1a; npm ls --depth0&#xff1a;僅顯示直接依賴&#xf…

其利天下即將亮相第21屆(順德)家電電源與智能控制技術研討會

2025年4月25日&#xff0c;第21屆&#xff08;順德&#xff09;家電電源與智能控制技術研討會即將拉開帷幕&#xff0c;其利天下應大比特之邀&#xff0c;確認將參加此次研討會。 本次研討會&#xff0c;我司委派研發總監馮建武先生圍繞《重新定義風扇驅動&#xff1a;一套算法…