主頁 >  其他 > 回溯

回溯

2022-11-08 07:18:02 其他

for回圈橫向遍歷,遞回縱向遍歷,回溯不斷調整結果集
畫樹,回溯要畫樹

77. 組合

給定兩個整數 n 和 k,回傳范圍 [1, n] 中所有可能的 k 個數的組合,
你可以按 任何順序 回傳答案,

result.add(new ArrayList(path)):開辟一個獨立地址,地址中存放的內容為path鏈表,后續path的變化不會影響到res

res.add(path):將res尾部指向了path地址,后續path內容的變化會導致res的變化,

class Solution {
    LinkedList<Integer> path = new LinkedList<>();
    List<List<Integer>> result = new ArrayList<>();

    public List<List<Integer>> combine(int n, int k) {
        backTracking(n,k,1);
        return result;
    }

    void backTracking(int n, int k, int startIndex){
        if(path.size()==k){
            result.add(new ArrayList<>(path));
            return;
        }
        for (int i = startIndex; i <= n; i++) {
            path.add(i);
            backTracking(n,k,i+1);
            path.removeLast();//回溯
        }
    }
}

剪枝操作優化代碼:

for (int i = startIndex; i <= n; i++) {

剪枝:

for (int i = startIndex; i <=n-(k-path.size())+1; i++) {

path.size() 是當前路徑里元素的個數
k-path.size() 是還需要的元素個數
n-(k-path.size())+1 至多走到哪里



216. 組合總和 III

找出所有相加之和為 n 的 k 個數的組合,且滿足下列條件:
只使用數字1到9
每個數字 最多使用一次 
回傳 所有可能的有效組合的串列 ,該串列不能包含相同的組合兩次,組合可以以任何順序回傳,

  • 這題和上面一題十分相似,就淺淺改了一下上面的代碼
class Solution {

     LinkedList<Integer> path = new LinkedList<>();
     List<List<Integer>> result = new ArrayList<>();

    public  List<List<Integer>> combinationSum3(int k, int n) {
        if(k > n){//如果n小于k的話直接回傳
            return result;
        }
        backTracking(k,n,1);
        return result;
    }

     void backTracking(int k, int n, int startIndex){

        if(path.size()==k){//陣列的長度達到標準之后
            int sum = 0;
            for (Integer p : path) {
                sum +=p;
            }
            if(sum == n){//看陣列中數字之和是否達到標準
                result.add(new ArrayList<>(path));
            }
            return;
        }
        for (int i = startIndex; i <= n; i++) {
            path.add(i);
            backTracking(k,n,i+1);
            path.removeLast();
        }
    }
}
  • 結果超出時間限制,因為沒有剪枝
for (int i = startIndex; i <= Math.min(n-(k*(k-1)/2),9) ; i++) {
  • k*(k-1)/2 是對前k-1個數的求和
  • n-(k*(k-1)/2) 和 9 取最小是怕n太大,k太小導致path里的數 > 9


17. 電話號碼的字母組合

給定一個僅包含數字 2-9 的字串,回傳所有它能表示的字母組合,答案可以按 任意順序 回傳,

  • 把按鍵上對應的數字轉換成字串letters,遍歷的時候要遍歷的是字串
class Solution {

     List<String> result = new ArrayList<>();
    static String[] letters = {"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};//下標就是按鍵上的數字

    public List<String> letterCombinations(String digits) {
        if(digits.equals(""))
             return result;//對特殊情況特殊處理
        backTracking(digits,0);//從零開始
        return result;
    }

    static StringBuilder sb = new StringBuilder();
    
     void backTracking(String digits, int index){
         //index指的是當前對哪個數字進行處理
         if(sb.length()==digits.length()){
            result.add(sb.toString());
            return;
         }
        String letter = letters[(digits.charAt(index))-'0'];//取當前下標對應的字串
        for (int i = 0; i < letter.length(); i++) {
            sb.append(letter.charAt(i));
            backTracking(digits,index+1);
            sb.deleteCharAt(sb.length()-1);
        }
    }
}
  • 感覺慢慢理解回溯了??


39. 組合總和

給你一個 無重復元素 的整數陣列 candidates 和一個目標整數 target ,找出 candidates 中可以使數字和為目標數 target 的 所有 不同組合 ,并以串列形式回傳,你可以按 任意順序 回傳這些組合,

  • 對組合問題的變形:允許元素重復使用,不固定路徑陣列的長度
class Solution {
    List<List<Integer>> res = new ArrayList<>();
    List<Integer> path = new ArrayList<>();

    public List<List<Integer>> combinationSum(int[] candidates, int target) {
        
        combine(candidates, target, 0);
        return res;
    }

    void combine(int[] candidates, int target, int startIndex){
        int sum = 0;
        //算出當前路徑的結點之和
        for (Integer node : path) {
            sum += node;
        }
        if(sum == target){
            res.add(new ArrayList<>(path));//得到符合條件的結果,把路徑加到結果集中
            return;
        }
        if(sum > target){
            return;//當前路徑上的結點之和已經大于所求,不用再往下加了
        }
        for (int i = startIndex; i < candidates.length; i++) {
            path.add(candidates[i]);//把當前的元素加入path中
            combine(candidates,target,i);
            path.remove(path.size()-1);
        }
    }
}



40. 組合總和 II

給定一個候選人編號的集合 candidates 和一個目標數 target ,找出 candidates 中所有可以使數字和為 target 的組合,
candidates 中的每個數字在每個組合中只能使用 一次 ,

  • 本題也是對組合問題的變形:candidates中的元素 無序 且 重復
  • 元素無序 給剪枝操作增加了難度,我在操作前對陣列candidates進行了排序
  • 元素重復 我的做法是對結果集res 新建了一個result進行去重,但是有的測驗用例超時
class Solution {
   List<List<Integer>> res = new ArrayList<>();
    List<Integer> path = new ArrayList<>();
    public List<List<Integer>> combinationSum2(int[] candidates, int target) {
        Arrays.sort(candidates);//先給陣列排序
        int length = candidates.length;
        for (int candidate : candidates) {
            if(candidate > target){
                length--;
            }
        }
        Arrays.copyOf(candidates,length);
        combine(candidates, target, 0);
        //此時已經拿到結果集res,但是需要對其進行去重操作
        List<List<Integer>> result = new ArrayList<>();
        for (List<Integer> re : res) {
            if (!result.contains(re)){
                result.add(re);//如果真正的結果集result中不包括re,就可以把re加入道result
            }
        }
        return result;
    }

    void combine(int[] candidates, int target, int startIndex){
        int sum = 0;
        //算出當前路徑的結點之和
        for (Integer node : path) {
            sum += node;
        }
        if(sum == target){
            res.add(new ArrayList<>(path));//得到符合條件的結果,把路徑加到結果集中
            return;
        }
        if(sum > target){
            return;//當前路徑上的結點之和已經大于所求,不用再往下加了
        }
        for (int i = startIndex; i < candidates.length; i++) {
            path.add(candidates[i]);//把當前的元素加入path中
            combine(candidates,target,i+1);
            path.remove(path.size()-1);
        }
    }
}
  • 就是這個用例超時,仔細瞅瞅這個用例,它說要對重復的資料進行處理,而不能只改結果集,確實,那樣效率太低了??
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
30
  • 我在for回圈中加入了如下陳述句,想使重復的元素跳出當前回圈
if(i>0&&candidates[i]==candidates[i-1]){
     continue;
}
  • 但是他把滿足條件的含有重復元素的結果也給剪掉了,是剪枝的條件出了問題
  • 把 i>0 換成 i>startIndex 后運行通過
if(i>startIndex&&candidates[i]==candidates[i-1]){



131. 分割回文串

給你一個字串 s,請你將 s 分割成一些子串,使每個子串都是 回文串 ,回傳 s 所有可能的分割方案,
回文串 是正著讀和反著讀都一樣的字串,

  • 這題是分割問題,但是本質和組合問題思路一樣
  • 剪枝的思路是:如果當前切出來的子串已經不是回文串了,就continue進入下一次回圈,這樣可以保證葉子結點都是滿足要求的path
class Solution {
    List<List<String>> res = new ArrayList<>();
    LinkedList<String> path = new LinkedList<>();

    public List<List<String>> partition(String s) {
        combine(s,0);
        return res;
    }

    void combine(String s, int startIndex){

        if(startIndex >= s.length()){
            res.add(new LinkedList<>(path));//識訓葉子結點
        }
        
        for (int i = startIndex; i < s.length(); i++) {
            if (isPalindromes(s,startIndex,i)){
                path.add(s.substring(startIndex,i+1));//因為subString()方法是左閉右開的
            } else {
                continue;//如果當前的子串都不是回文串,已經不滿足題意,不必再往下切了
            }
            combine(s,i+1);//再往樹的下一層遍歷
            path.removeLast();//回溯
        }
        
    }
    // 判斷是否是回文子串
    boolean isPalindromes(String s, int startIndex, int endIndex){
        while (true){
            if(startIndex > endIndex){
                return true;
            }
            if(s.charAt(startIndex)==s.charAt(endIndex)){
                startIndex++;
                endIndex--;
            } else {
                return false;
            }
        }
    }
}



93. 復原 IP 地址

有效 IP 地址 正好由四個整數(每個整數位于 0 到 255 之間組成,且不能含有前導 0),整數之間用 '.' 分隔,
給定一個只包含數字的字串 s ,用以表示一個 IP 地址,回傳所有可能的有效 IP 地址,這些地址可以通過在 s 中插入 '.' 來形成,你 不能 重新排序或洗掉 s 中的任何數字,你可以按 任何 順序回傳答案,

? ? ? 不是自己寫出來的

  • 按照自己本來的思路寫,是new了一個StringBuilder,想著這樣操作方便些,但是很難回溯啊,就把自己繞進去了,下面的題解是在String上用subString()的方法操作
  • 還有遞回出口,要專門創建一個int去記錄逗點的數量
class Solution {

    List<String> result = new ArrayList<>();

    public List<String> restoreIpAddresses(String s) {
        if (s.length() > 12) return result; // 算是剪枝了
        backTrack(s, 0, 0);
        return result;
    }

    // startIndex: 搜索的起始位置, pointNum:添加逗點的數量
    private void backTrack(String s, int startIndex, int pointNum) {
        if (pointNum == 3) {// 逗點數量為3時,分隔結束
            // 判斷第四段?字串是否合法,如果合法就放進result中
            if (isValid(s,startIndex,s.length()-1)) {
                result.add(s);
            }
            return;
        }
        for (int i = startIndex; i < s.length(); i++) {
            if (isValid(s, startIndex, i)) {
                s = s.substring(0, i + 1) + "." + s.substring(i + 1);//在str的后?插??個逗點
                pointNum++;
                backTrack(s, i + 2, pointNum);// 插?逗點之后下?個?串的起始位置為i+2
                pointNum--;// 回溯
                s = s.substring(0, i + 1) + s.substring(i + 2);// 回溯掉剛剛插入的逗點
            } else {
                break;//這里用break而不是continue是因為如果當前情況就不符合條件,再往后遍歷,數字只會越來越大,更不符合條件
            }
        }
    }

    // 判斷字串s在左閉?閉區間[start, end]所組成的數字是否合法
    private Boolean isValid(String s, int start, int end) {
        if (start > end) {
            return false;
        }
        if (s.charAt(start) == '0' && start != end) { // 0開頭的數字不合法
            return false;
        }
        int num = 0;
        for (int i = start; i <= end; i++) {
            if (s.charAt(i) > '9' || s.charAt(i) < '0') { // 遇到?數字字符不合法
                return false;
            }
            num = num * 10 + (s.charAt(i) - '0');
            if (num > 255) { // 如果?于255了不合法
                return false;
            }
        }
        return true;
    }
}
  • 回溯是把當前for回圈里的操作給回溯掉,干干凈凈的進入下一個回圈
  • 感覺這一題是挺難的,現在還有點沒迷過來??


78. 子集

給你一個整數陣列 nums ,陣列中的元素 互不相同 ,回傳該陣列所有可能的子集(冪集),
解集 不能 包含重復的子集,你可以按 任意順序 回傳解集,

class Solution {
     LinkedList<Integer> path = new LinkedList<>();
     List<List<Integer>> res = new LinkedList<>();

    public  List<List<Integer>> subsets(int[] nums) {
        res.add(new LinkedList<>(path));//把空的path進去
        combine(nums,0);
        return res;
    }

     void combine(int[] nums, int startIndex){

        if(!path.isEmpty()&&path.getLast()==nums[nums.length-1]){
            return;//遞回出口
        }

        for (int i = startIndex; i < nums.length; i++) {
            path.add(nums[i]);
            res.add(new LinkedList<>(path));//每一個結點都要收集
            combine(nums,i+1);
            path.removeLast();//回溯
        }
    }
}
  • 這題比較簡單,子集的特點就是每一個結點都要收集,那我們在添加路徑時收集就可以了
  • 遞回的出口是當path最后一個數是陣列中的最后一個數時,不再向下遞回


90. 子集 II

給你一個整數陣列 nums ,其中可能包含重復元素,請你回傳該陣列所有可能的子集(冪集),
解集 不能 包含重復的子集,回傳的解集中,子集可以按 任意順序 排列,

  • 這題和之前相比就多了一個去重操作,先排序后去重
class Solution {
     LinkedList<Integer> path = new LinkedList<>();
     List<List<Integer>> res = new LinkedList<>();

    public  List<List<Integer>> subsetsWithDup(int[] nums) {
        res.add(new LinkedList<>(path));//把空的path進去
        Arrays.sort(nums);//先排序
        combine(nums,0);
        return res;
    }

     void combine(int[] nums, int startIndex){
        for (int i = startIndex; i < nums.length; i++) {
            if (i > startIndex && nums[i] == nums[i - 1]) {
                continue;//去重
            }
            path.add(nums[i]);
            res.add(new LinkedList<>(path));//每一個結點都要收集
            combine(nums,i+1);
            path.removeLast();//回溯
        }
    }
}



491. 遞增子序列

給你一個整數陣列 nums ,找出并回傳所有該陣列中不同的遞增子序列,遞增子序列中 至少有兩個元素 ,你可以按 任意順序 回傳答案,
陣列中可能含有重復元素,如出現兩個整數相等,也可以視作遞增序列的一種特殊情況,

class Solution {

    List<List<Integer>> res = new ArrayList<>();
    ArrayList<Integer> path = new ArrayList<>();
    public List<List<Integer>> findSubsequences(int[] nums) {
        combine(nums, 0);
        return res;
    }
    void combine(int[] nums, int startIndex) {
        if (path.size() > 1) {
            res.add(new ArrayList<>(path));
        }
        Map<Integer, Integer> map = new HashMap();//每層一個map
        for (int i = startIndex; i < nums.length; i++) {
            if (!path.isEmpty() && nums[i] < path.get(path.size() - 1)) {
                continue;//剪枝
            }
            if(map.getOrDefault(nums[i],0)>0){//如果該元素的value不是0,說明之前添加過,直接進下一次回圈
                continue;//去重
            }
            map.put(nums[i],map.getOrDefault(nums[i],0)+1);//第一次遍歷到該元素時,以陣列元素為key,value賦1
            path.add(nums[i]);
            combine(nums, i + 1);
            path.remove(path.size() - 1);//回溯
        }
    }
}
  • 這里去重是用map實作的

default V getOrDefault ?( Object key , V defaultValue ) 回傳指定key映射到的value,如果當前map不包含當前key的映射,則回傳 defaultValue ,



46. 全排列

給定一個不含重復數字的陣列 nums ,回傳其 所有可能的全排列 ,你可以 按任意順序 回傳答案,

  • 全排列問題 還是要畫樹

  • 回圈遍歷當前path中沒有的數

List<List<Integer>> res = new ArrayList<>();
    List<Integer> path = new ArrayList<>();

    public List<List<Integer>> permute(int[] nums) {
        combine(nums);
        return res;
    }
    void combine(int[] nums){
        if (path.size()== nums.length){
            res.add(new ArrayList<>(path));//收集結果
        }
        for (int num : nums) {
            if (path.contains(num)) {
                continue;//如果路徑里有num,跳出此次回圈
            }
            path.add(num);
            combine(nums);
            path.remove(path.size()-1);
        }

    }



47. 全排列 II

給定一個可包含重復數字的序列 nums ,按任意順序 回傳所有不重復的全排列,

只做樹層的去重,不做樹枝的去重

  • nums[i]=nums[i-1]并且used[i-1]=true說明nums[i-1]已經被加進了path中,這是數枝的重復

  • nums[i]=nums[i-1]并且used[i-1]=false說明nums[i-1]已經被回溯成了false,這是樹層的重復,要剪掉?

  • 新建了一個used陣列來表示nums陣列的使用情況

class Solution {
    List<List<Integer>> res = new ArrayList<>();
    List<Integer> path = new ArrayList<>();
    boolean[] used;

    public List<List<Integer>> permuteUnique(int[] nums) {
        used = new boolean[nums.length];
        for (boolean b : used) {
            b=false;
        }
        Arrays.sort(nums);
        comine(nums,used);
        return res;
    }

    void comine(int[] nums, boolean[] used) {

        if (path.size() == nums.length) {
            res.add(new ArrayList<>(path));//收集結果
        }
        for (int i = 0; i < nums.length; i++) {
            if (i>0&&nums[i]==nums[i-1]&&used[i-1]==false) {
                continue;//當前數和前面的數相等并且前面的數還未使用時
            }
            if(used[i]==false){//當前元素還未使用時
                path.add(nums[i]);
                used[i]=true;//在path中添加元素,該位置標記為true
                comine(nums,used);
                path.remove(path.size() - 1);//回溯
                used[i]=false;//回溯
            }
        }
    }
}

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/528812.html

標籤:其他

上一篇:關于入門深度學習mnist資料集前向計算的記錄

下一篇:「組合數學」隔離區

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more