原创 算法導論第15章習題15.1-4

定義全局變量k存儲子函數計算最大收益時的變量i #include "stdafx.h" #include <iostream> using namespace std; int k=0; int Max(int a, int b) {re

原创 算法導論第15章15.2-5

第九行 for 循環執行j-i次,即爲l-1次,調用m[i,j] 2(l-1)次,加上外面兩層循環一共1/3(n^3-n)

原创 java 講字符串轉換爲字符數組

package test; public class stirngtest { public static void main(String args[]){ char a[][]=new char[21][2

原创 leetcode--150

class Solution: def evalRPN(self, tokens: List[str]) -> int: s = [] res = 0 if len(tokens

原创 python 二維數組創建的陷阱

官方文檔上的例子。[[]]*3 是指向內部空的list([])的指針,也就是說[[],[],[]]內部的三個list實際上內存地址是相同的,所以 不要用這個方法創建二維數組,官方建議用([[] for in range(n)])的方式!!

原创 牛客網--相反數

n=input() s=int(n)+int(n[::-1]) print(s) import java.util.Scanner; public class Main { public static void main(

原创 Java求最小值

Java求最小值 import java.io.IOException; import java.util.Scanner; public class Main { public static

原创 Difference between "Distribute Content" and "Update Distribution Points"(SCCM)

 Distribute Content is for adding the content to a distribution point the first time. After that you should use Updat

原创 算法導論第18章 18-1

18.1-1      根據B樹的定義 每個節點包含的關鍵字的個數有上界和下界,用一個被稱爲B樹的最小度數的固定整數t來表示這些界。 除了根節點以外的每個節點必須至少有t-1個關鍵字。除了根節點以外的每個內部節點至少有t個孩子,如果樹非空

原创 英語學習

fixate on  相當於 focus  on ,專注於某事 crush   on 迷戀 點贊 收藏 分享 文章舉報 u010969626 發佈了66 篇原創文章 · 獲贊

原创 又要寫博客了,這次是關於前端的target

         <a>標籤  的 可以使用target屬性來設置打開新的窗口,而如果多個窗口的target屬性值是相同的,但是並不是“_blank

原创 java 獲取當前工作路徑(macOS)

package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) {

原创 java創建對象的方法

package com.company; public class B implements Cloneable { public void hello(){ System.out.println("hello

原创 算法導論第六章6.4

6.4-1  注意要先建最大堆,每次交換後要保持最大堆的性質。 6.4-2  先說說什麼是循環不變量,所謂循環不變量就是在某個循環過程維持某個性質不變。(比如求最大值,最大堆,最小堆,最小值,這個性質在每次循環過程中都是不變的) 針對該題

原创 算法導論第15章15.2-1

找了一段C實現的矩陣鏈乘法 #include "stdafx.h" #include<stdio.h> #include<string.h> #define N 1000 int m[N][N];  //m[i][j]表示從第i個矩陣乘到