Skip to content

Commit 480963c

Browse files
authored
Merge branch 'dostonnabotov:main' into main
2 parents 0cf9d93 + 3fb7bea commit 480963c

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.github/workflows/consolidate-snippets.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ jobs:
3434
git config --global user.name "GitHub Action"
3535
git config --global user.email "[email protected]"
3636
git add public/consolidated/*
37+
git add public/icons/*
3738
git commit -m "Update consolidated snippets"
3839
git push

public/consolidated/cpp.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@
1717
}
1818
]
1919
},
20+
{
21+
"categoryName": "Data Structure Conversion",
22+
"snippets": [
23+
{
24+
"title": "Vector to Queue",
25+
"description": "Convert vector into queue quickly",
26+
"author": "mrityunjay2003",
27+
"tags": [
28+
"cpp",
29+
"data structures",
30+
"queue",
31+
"vector"
32+
],
33+
"contributors": [],
34+
"code": "#include<queue>\n#include<vector>\n#include<deque>\n\nstd::queue<int> vectorToQueue(const std::vector<int>& v) {\n return std::queue<int>(std::deque<int>(v.begin(), v.end()));\n}\n"
35+
}
36+
]
37+
},
2038
{
2139
"categoryName": "Math And Numbers",
2240
"snippets": [
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Vector to Queue
3+
description: Convert vector into queue quickly
4+
tags: cpp, data structures,queue,vector
5+
author: mrityunjay2003
6+
---
7+
8+
```cpp
9+
#include<queue>
10+
#include<vector>
11+
#include<deque>
12+
13+
std::queue<int> vectorToQueue(const std::vector<int>& v) {
14+
return std::queue<int>(std::deque<int>(v.begin(), v.end()));
15+
}
16+
```

0 commit comments

Comments
 (0)