原创 Remove Duplicates from Sorted Array II--leetcode 我的java題解
題目是Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For example, Given sorted arr
原创 學習Stack,並實現從尾到頭打印鏈表LinkedList
<p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">棧的定義 棧(Stack)是限制僅在表的一端
原创 Remove Duplicates from Sorted List ---Leetcode 我的java題解
Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2
原创 intellij自動排版的快捷鍵是Ctrl+Alt+L,怎麼改
intellij裏面,自動排版的快捷鍵是在 KeyMap裏設置嗎? 英文名是automatic typesetting嗎? 找不到啊,每次按了沒反應。 經高手提示,終於搞定了,默認的快捷鍵是Ctrl+Alt+L, 結果老版的QQ也是用
原创 java從尾到頭打印鏈表
#include #include typedef struct LinkNode{ struct LinkNode*prior; struct LinkNode*next; int data; }LinkNode,*L
原创 Remove Duplicates from Sorted Array---leetcode 我的java題解
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new lengt
原创 leetcode - Maximum Depth of Binary Tree C#
原題連接:https://leetcode.com/problems/maximum-depth-of-binary-tree/ Given a binary tree, find its maximum depth. The ma
原创 明白機會成本太遲了.........
我不知道做了家庭主婦後得抑鬱的比例是多少。但是我每天都在回顧過往,感覺自己做錯的決定太多了,任何事情都是有機會成本,這個道理我明白的太遲了以至於到了現在的這步田地。而對將來也猶豫沒自信。 道理明白的太遲,別人的建議以前也不能領會,一直悶頭
原创 Same Tree Leetcode c#
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if t
原创 一個面試題
面試題: 給定一個int array A 和一個integer k。return 一個int[] B such that B[i] = min{A[i], A[i + 1], .... A[i +k -1]}. 題目沒要求複雜度,所以我
原创 Remove Duplicates from Sorted List II-- Leetcode 我的java題解
題目描述:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the
原创 一個有頭尾的單鏈表,長度未知,如何快速的找出位於中間的那個元素?
設置兩個指針,p1,p2, 開始p1,p2均位於鏈接的頭部。p1 每次步進兩步,p2 每次步進一步當p1到達鏈表的末尾時,p2所在的位置就是鏈表的中間元素 這個題目在給一個遞增的鏈表轉換成二分查找樹時用到了。 發現很多算法題都會用到雙指
原创 c# 加密算法集錦
using System; using System.Security.Cryptography; using System.IO; using System.Text; //1、將字符串轉換成字節數組 //2
原创 Single Number---leetcode c# solution
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm sh
原创 在c# winform 的 monthCalendar 裏粗體凸顯有數據的日期
我查了很多資料,發現 winform 的現成的日曆控件沒有 web界面裏日曆的DayRender 功能。 很多人爲實現凸顯是自己重新畫了一個日曆。 我目前折中了下凸顯成粗體。 效果如圖:如果凸顯成有顏色的日期,我還不會做。 例子: 在