This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _CRT_SECURE_NO_WARNINGS | |
#include<stdio.h> | |
#include<stdlib.h> | |
#define isdigit(x) (((unsigned int)x - '0') < 10u) | |
void print_num(int n){//只能丟正數進來 | |
if (n > 9){ | |
int a = n / 10; | |
n -= 10 * a; | |
print_num(a); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _CRT_SECURE_NO_WARNINGS | |
#include <iostream> | |
#define MAX_SIZE 71//stack最大容量,依題目所訂 | |
#define PUSH (size++)//push新東西進stack,並將size+1 | |
#define POP (--size)//從stack pop出最上面的東西,並將size-1 | |
#define TOP (size-1)//回傳stack最上面的東西 | |
#define isdigit(x) ((x)>='0' && (x)<='9')//判斷是否為數字字元 | |
using namespace std; | |
int my_strlen(char* input); | |
bool check_brackets(char* input, int length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<fstream> | |
#include<iostream> | |
#include<string> | |
#include<vector> | |
#include<sstream> | |
#include<bitset> | |
using namespace std; | |
class Node { | |
public: | |
int else_edge,then_edge;//index of arrayreduced_order() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************ | |
File: Maze.cpp | |
Author: | |
Stephen Chenney, schenney@cs.wisc.edu | |
Modifier | |
Yu-Chi Lai, yu-chi@cs.wisc.edu | |
Comment: | |
(c) 2001-2002 Stephen Chenney, University of Wisconsin at Madison | |
Class header file for Maze class. Manages the maze. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
#include <string> | |
using namespace std; | |
template<typename T> | |
class BST_node {//BST節點的class | |
public: | |
BST_node() {} | |
BST_node(T _data):data(_data) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
template<typename T,unsigned int order> | |
class B_tree_node {//B樹節點 | |
public: | |
//constructor | |
B_tree_node() {set_null();}//啥都沒 | |
B_tree_node(B_tree_node<T, order>* f) : father(f) {set_null();}//有給爸爸 | |
B_tree_node(T new_data) {//有給資料 | |
set_null(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph STG { | |
rankdir=LR; | |
INIT [shape=point]; | |
a [label="a"]; | |
b [label="b"]; | |
c [label="c"]; | |
d [label="d"]; | |
e [label="e"]; | |
f [label="f"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
template<typename element,typename order>//element是heap內的資料型別(int),order是優先權的資料型別(char) | |
class heap_node {//heap node的class | |
public: | |
heap_node() {} | |
heap_node(element i, order p, heap_node<element, order>* f) : data(i), priority(p),father(f) {} | |
template<typename, typename> friend class heap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <set> | |
#include <algorithm> | |
#include <iomanip> | |
using namespace std; | |
template<typename N,typename P> | |
//N 為名稱資料型別 P為probability資料型別 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <string> | |
#include <set> | |
#include <iostream> | |
#include <numeric> | |
#include <unordered_map> | |
#include <iterator> | |
#include <chrono> | |
#include <sstream> | |
using namespace std; |
OlderNewer