35 lines
553 B
C++
35 lines
553 B
C++
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <stack>
|
|
|
|
namespace yaha {
|
|
class CQueue {
|
|
public:
|
|
CQueue() {
|
|
}
|
|
|
|
void append_tail(int value);
|
|
int delete_head();
|
|
|
|
private:
|
|
std::stack<int> _stk_tail;
|
|
std::stack<int> _stk_head;
|
|
};
|
|
|
|
class String {
|
|
public:
|
|
std::string replace_space(std::string s);
|
|
};
|
|
|
|
class ListNode {
|
|
public:
|
|
int val;
|
|
ListNode *next;
|
|
ListNode(int x) : val(x), next(NULL) {}
|
|
std::vector<int> reverse_print(ListNode *head);
|
|
void reverse(ListNode *head, std::vector<int>& res);
|
|
};
|
|
|
|
} |