实现链表打印
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#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);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user