-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsets.h
40 lines (32 loc) · 816 Bytes
/
sets.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef SETS_H
#define SETS_H
#include <iostream>
struct ListNode
{
char data;
ListNode* next;
ListNode (char d, ListNode* n=nullptr) : data{d}, next{n} {};
~ListNode() { delete next; };
};
namespace SetsOperations
{
char* unite(char*, char*);
char* cross(char*, char*);
char* triple_cross(char*, char*, char*);
};
namespace ListOperations
{
ListNode* str_to_list(char* str);
ListNode* add_element_to_list(ListNode* list_head, char ch);
bool is_element_in_list(ListNode* list_head, char ch);
void show(ListNode* head);
ListNode* cross(ListNode* head_1, ListNode* head_2);
ListNode* unite(ListNode* head_1, ListNode* head_2);
};
namespace BitsOperations
{
int ctb(char ch);
std::string bts(int bytes);
int stb(const std::string& str);
};
#endif