原创 解決spring+Mybatis的整合測試問題

                  第一次使用ssm,參考文章                  http://blog.csdn.net/zhshulin/article/details/37956105#              

原创 struts與jsp之間的值傳遞

                    1.jsp向action                      jsp:                       <form action="strust2Test!login.actio

原创 19. Remove Nth Node From End of List

#include<iostream> #include <cstdio> using namespace std; struct ListNode { int val; ListNode *next; Li

原创 240. Search a 2D Matrix II

     此題考查楊氏矩陣的搜索,這裏採用的是Step-wise線性搜索解法,其餘的方法可參考http://blog.csdn.net/pi9nc/article/details/9082997 以下爲完整的程序: #include<io

原创 160. Intersection of Two Linked Lists

         這道題很簡單,思路大概是找出最長的那個鏈表,然後長鏈表從頭開始除掉比短鏈表長的那一部分,當然不是刪掉,移動一下指針就行了,這樣下來兩個鏈表就對齊了。之後,一對一的比較,若相同就是交匯處,到遍歷完時,沒有找到交叉點,那就是

原创 61. Rotate List

ListNode* rotateRight(ListNode* head, int k) { if(head==NULL) return NULL; ListNode* p,*q; int i=

原创 92. Reverse Linked List II

#include<iostream> #include <cstdio> using namespace std; struct ListNode { int val; ListNode *next; Li

原创 windows下 Qt5的exe打包運行

            若要把自己電腦裏編譯運行得到的exe也能在其他電腦上運行,需要按以下幾步做,網上有什麼修改配置文件,以期達到靜態編譯的效果,

原创 24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head. Fo

原创 Python逆序打印正整數

                Python逆序打印正整數,遞歸,不使用全局變量          >>> def reverse(x): str=chr(x%10+ord('0')) if(x>=10): x=(int)

原创 141. Linked List Cycle

bool hasCycle(ListNode *head) { ListNode *p,*q; p=head; q=head; while(q!=NULL&&q->next!=NULL){

原创 136. Single Number

      史上最水的題。。。當然如果用了sort...        Given an array of integers, every element appears twice except for one. Find that

原创 97. Interleaving String

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given:s1 = "aabcc",s2 = "d

原创 qt5中文亂碼

             當字符串類型是QString時,要正確顯示出來中文,可用              QTextCodec *codec = QTextCodec::codecForName("UTF-8");          

原创 337. House Robber III

The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "r