響鈴,如果輸入為N則響鈴N次,否則不會響鈴
標簽:
上傳時間: 2014-01-22
上傳用戶:宋桃子
Input : A set S of planar points Output : A convex hull for S Step 1: If S contains no more than five points, use exhaustive searching to find the convex hull and return. Step 2: Find a median line perpendicular to the X-axis which divides S into SL and SR SL lies to the left of SR . Step 3: Recursively construct convex hulls for SL and SR. Denote these convex hulls by Hull(SL) and Hull(SR) respectively. Step 4: Apply the merging procedure to merge Hull(SL) and Hull(SR) together to form a convex hull. Time complexity: T(n) = 2T(n/2) + O(n) = O(n log n)
標簽: contains Output convex planar
上傳時間: 2017-02-19
上傳用戶:wyc199288
The Bit Array structure provides a compacted arrays of Booleans, with one bit for each Boolean value. A 0 [1] bit corresponds to the Boolean value false [true], respectively. We can look at a stream of bytes as a stream of bits each byte contains 8 bits, so any n bytes hold n*8 bits. And the operation to manipulate this stream or bits array is so easy, jut read or change the bits state or make any Boolean operation on the whole bits array, like 鈥楢ND鈥? 鈥極R鈥? or 鈥榅OR鈥?
標簽: structure compacted Booleans provides
上傳時間: 2014-01-15
上傳用戶:壞天使kk
//建立頂級窗口 toplevel = XtVaAppInitialize[&app, "DrawArea", NULL, 0, &argc, argv, NULL, NULL] //建立drawarea n = 0 XtSetArg[args[n], XmNwidth, 500 ] n++ XtSetArg[args[n], XmNheight, 500 ] n++ drawarea = XmCreateDrawingArea[toplevel, "drawarea", args, n] XtManageChild[drawarea] //建立繪圖所用的GC prepare[]
標簽: NULL XtVaAppInitialize toplevel DrawArea
上傳時間: 2013-12-29
上傳用戶:a6697238
//建立頂級窗口 toplevel = XtVaAppInitialize[&app, "Frame", NULL, 0, &argc, argv, NULL, NULL] //建立Frame組件 n = 0 XtSetArg[args[n], XmNshadowType, XmSHADOW_ETCHED_IN] n++ XtSetArg[args[n], XmNshadowThickness, 4] n++ frame = XmCreateFrame[toplevel, "frame", args, n] XtManageChild[frame]
標簽: NULL XtVaAppInitialize toplevel Frame
上傳時間: 2013-12-08
上傳用戶:hasan2015
//建立頂級窗口 toplevel = XtVaAppInitialize[&app, "Label", NULL, 0, &argc, argv, NULL, NULL] //建立按鈕上標簽的字符串 str = XmStringCreateLtoR["A Simple\n Label", XmFONTLIST_DEFAULT_TAG] n = 0 XtSetArg[args[n], XmNlabelString, str] n++ label = XmCreateLabel[toplevel, "pushbutton", args, n] XtManageChild[label] XmStringFree[str] //顯示窗口 XtRealizeWidget[toplevel] //進入事件循環 XtAppMainLoop[app]
標簽: NULL XtVaAppInitialize toplevel Label
上傳時間: 2014-01-11
上傳用戶:bruce5996
setlocale[LC_ALL, ""] XtSetLanguageProc[NULL, NULL, NULL] //建立頂級窗口 toplevel = XtVaAppInitialize[&app, "SpinBox", NULL, 0, &argc, argv, NULL, NULL] //建立SpinBox n = 0 XtSetArg[args[n], XmNwidth, 400 ] n++ XtSetArg[args[n], XmNheight, 100 ] n++ //XtSetArg[args[n], XmNarrowLayout, XmARROWS_FLAT_END] n++ XtSetArg[args[n], XmNrepeatDelay, 0] n++ //XtSetArg[args[n], XmNarrowOrientation, XmHORIZONTAL] n++ spinbox = XmCreateSpinBox[toplevel, "SpinBox", args, n] XtManageChild[spinbox] XtAddCallback [spinbox, XmNvalueChangedCallback, [XtCallbackProc]ValueChanged, [XtPointer]NULL] XtAddCallback [spinbox, XmNmodifyVerifyCallback, [XtCallbackProc]ModifyVerify, [XtPointer]NULL]
標簽: NULL XtSetLanguageProc setlocale toplevel
上傳時間: 2017-03-25
上傳用戶:lmeeworm
//建立頂級窗口 toplevel = XtVaAppInitialize[&app, "Scroll", NULL, 0, &argc, argv, NULL, NULL] //建立SpinBox n = 0 XtSetArg[args[n], XmNwidth, 400 ] n++ XtSetArg[args[n], XmNheight, 100 ] n++ //XtSetArg[args[n], XmNarrowLayout, XmARROWS_FLAT_END] n++ XtSetArg[args[n], XmNrepeatDelay, 0] n++ //XtSetArg[args[n], XmNarrowOrientation, XmHORIZONTAL] n++ spinbox = XmCreateSpinBox[toplevel, "SpinBox", args, n] XtManageChild[spinbox] XtAddCallback [spinbox, XmNvalueChangedCallback, [XtCallbackProc]ValueChanged, [XtPointer]NULL] XtAddCallback [spinbox, XmNmodifyVerifyCallback, [XtCallbackProc]ModifyVerify, [XtPointer]NULL]
標簽: NULL XtVaAppInitialize toplevel Scroll
上傳時間: 2013-12-26
上傳用戶:fxf126@126.com
此程序改自算法課的一個作業,用四種不同的算法,對隨機生成的n個數排序(n取值500至5000),并重復n遍,最后統計平均比較次數。本在xp下用vc6編寫,現在修改為Ubuntu下gcc編譯。 sortArchieve.c內為各個排序算法的實現
上傳時間: 2014-01-22
上傳用戶:linlin
雜波的一個MATLAB仿真,雜波的產生:先生成一個(0,1)分布的隨機數r,讓后根據poission分布產生雜波的個數n,這n個雜波是服從均勻分布
上傳時間: 2013-12-20
上傳用戶:Pzj