Skip to content

Commit 2c17bf7

Browse files
authored
Create copilot-instructions.md (#186)
1 parent b397c7d commit 2c17bf7

File tree

131 files changed

+9180
-7701
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+9180
-7701
lines changed

.github/copilot-instructions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
When reviewing a pull request:
2+
- Verify that any added algorithms or data structures aren’t already implemented elsewhere in the repository (including under a different name).
3+
- Confirm that the proposed algorithm is a recognized computer-science algorithm, not a problem-specific adaptation of a general technique (e.g., tuned for LeetCode or other competitive-programming problems).
4+
- Check that the extension of all code file names is a lowercase r.
5+
- Check that DIRECTORY.md was updated correctly.

DIRECTORY.md

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
## Data Manipulation
2626
* [Label Encode](https://github.com/TheAlgorithms/R/blob/HEAD/data_manipulation/label_encode.r)
2727
* [One Hot Encode](https://github.com/TheAlgorithms/R/blob/HEAD/data_manipulation/one_hot_encode.r)
28-
* [Shorten Vector](https://github.com/TheAlgorithms/R/blob/HEAD/data_manipulation/shorten.vector.R)
28+
* [Shorten.Vector](https://github.com/TheAlgorithms/R/blob/HEAD/data_manipulation/shorten.vector.r)
2929

3030
## Data Preprocessing
3131
* [Data Normalization Standardization](https://github.com/TheAlgorithms/R/blob/HEAD/data_preprocessing/data_normalization_standardization.r)
@@ -34,14 +34,24 @@
3434
* [K Folds](https://github.com/TheAlgorithms/R/blob/HEAD/data_preprocessing/k_folds.r)
3535
* [Lasso](https://github.com/TheAlgorithms/R/blob/HEAD/data_preprocessing/lasso.r)
3636

37-
## Dynamic Programming
38-
* [Longest Common Subsequence](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/longest_common_subsequence.r)
3937
## Data Structures
4038
* [Binary Search Tree](https://github.com/TheAlgorithms/R/blob/HEAD/data_structures/binary_search_tree.r)
39+
40+
## Dynamic Programming
41+
* 0
42+
* 0
43+
* [1 Knapsack Problem](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/0/0/1_knapsack_problem.r)
44+
* [1 Knapsack Problem](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/0/1_knapsack_problem.r)
45+
* [Coin Change](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/coin_change.r)
46+
* [Longest Common Subsequence](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/longest_common_subsequence.r)
47+
* [Longest Increasing Subsequence](https://github.com/TheAlgorithms/R/blob/HEAD/dynamic_programming/longest_increasing_subsequence.r)
48+
4149
## Graph Algorithms
42-
* [Dijkstra Shortest Path](https://github.com/TheAlgorithms/R/blob/HEAD/graph_algorithms/dijkstra_shortest_path.r)
4350
* [Breadth First Search](https://github.com/TheAlgorithms/R/blob/HEAD/graph_algorithms/breadth_first_search.r)
4451
* [Depth First Search](https://github.com/TheAlgorithms/R/blob/HEAD/graph_algorithms/depth_first_search.r)
52+
* [Dijkstra Shortest Path](https://github.com/TheAlgorithms/R/blob/HEAD/graph_algorithms/dijkstra_shortest_path.r)
53+
54+
## [Levenshtein](https://github.com/TheAlgorithms/R/blob/HEAD//levenshtein.r)
4555

4656
## Mathematics
4757
* [Amicable Numbers](https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/amicable_numbers.r)
@@ -63,6 +73,11 @@
6373
* [Prime](https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/prime.r)
6474
* [Sieve Of Eratosthenes](https://github.com/TheAlgorithms/R/blob/HEAD/mathematics/sieve_of_eratosthenes.r)
6575

76+
## Quantitative Finance
77+
* [Kalman Filter](https://github.com/TheAlgorithms/R/blob/HEAD/quantitative_finance/kalman_filter.r)
78+
* [Markowitz Portfolio Optimization](https://github.com/TheAlgorithms/R/blob/HEAD/quantitative_finance/markowitz_portfolio_optimization.r)
79+
* [Monte Carlo Simulation](https://github.com/TheAlgorithms/R/blob/HEAD/quantitative_finance/monte_carlo_simulation.r)
80+
6681
## Regression Algorithms
6782
* [Ann](https://github.com/TheAlgorithms/R/blob/HEAD/regression_algorithms/ann.r)
6883
* [Gradient Boosting Algorithms](https://github.com/TheAlgorithms/R/blob/HEAD/regression_algorithms/gradient_boosting_algorithms.r)
@@ -77,6 +92,8 @@
7792
## Searches
7893
* [Binary Search](https://github.com/TheAlgorithms/R/blob/HEAD/searches/binary_search.r)
7994
* [Linear Search](https://github.com/TheAlgorithms/R/blob/HEAD/searches/linear_search.r)
95+
* [Rabin.Karp.String.Search](https://github.com/TheAlgorithms/R/blob/HEAD/searches/rabin.karp.string.search.r)
96+
* [Z.Algorithm.Search](https://github.com/TheAlgorithms/R/blob/HEAD/searches/z.algorithm.search.r)
8097

8198
## Sorting Algorithms
8299
* [Binary Insertion Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/binary_insertion_sort.r)
@@ -86,30 +103,35 @@
86103
* [Comb Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/comb_sort.r)
87104
* [Counting Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/counting_sort.r)
88105
* [Cycle Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/cycle_sort.r)
106+
* [Gnome Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/gnome_sort.r)
89107
* [Heap Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/heap_sort.r)
90108
* [Insertion Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/insertion_sort.r)
91109
* [Merge Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/merge_sort.r)
92110
* [Odd Even Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/odd_even_sort.r)
93111
* [Pancake Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/pancake_sort.r)
112+
* [Patience Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/patience_sort.r)
94113
* [Quick Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/quick_sort.r)
95114
* [Radix Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/radix_sort.r)
96115
* [Selection Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/selection_sort.r)
97116
* [Shell Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/shell_sort.r)
98117
* [Stooge Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/stooge_sort.r)
118+
* [Strand Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/strand_sort.r)
119+
* [Tim Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/tim_sort.r)
99120
* [Topological Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/topological_sort.r)
100-
* [Wiggle Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/wiggle_sort.r)
121+
* [Wiggle Sort](https://github.com/TheAlgorithms/R/blob/HEAD/sorting_algorithms/wiggle_sort.r)
101122

102123
## String Manipulation
103-
* [Find Palindrome](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/findPalindrome.R)
104-
* [Is Anagram](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/is.anagram.R)
105-
* [Is Lower](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/is.lower.R)
106-
* [Is Uppercase](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/is.uppercase.R)
107-
* [Mask Words](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/maskWords.R)
108-
* [Rearrange Ways](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/rearrangeWays.R)
109-
110-
## Quantitative Finance
111-
* [Kalman Filter](https://github.com/TheAlgorithms/R/blob/HEAD/quantitative_finance/kalman_filter.r)
112-
* [Markowitz Portfolio Optimization](https://github.com/TheAlgorithms/R/blob/HEAD/quantitative_finance/markowitz_portfolio_optimization.r)
113-
* [Monte Carlo Simulation](https://github.com/TheAlgorithms/R/blob/HEAD/quantitative_finance/monte_carlo_simulation.r)
114-
115-
```
124+
* [Burrows](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/burrows.r)
125+
* [Findpalindrome](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/findpalindrome.r)
126+
* [Is.Anagram](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/is.anagram.r)
127+
* [Is.Lower](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/is.lower.r)
128+
* [Is.Uppercase](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/is.uppercase.r)
129+
* [Longest.Palindromic.Subsequence](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/longest.palindromic.subsequence.r)
130+
* [Longest.Substring.No.Repeat](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/longest.substring.no.repeat.r)
131+
* [Manacher.Longest.Palindrome](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/manacher.longest.palindrome.r)
132+
* [Maskwords](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/maskwords.r)
133+
* [Min.Palindromic.Insert](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/min.palindromic.insert.r)
134+
* [Minimum.Window.Substring](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/minimum.window.substring.r)
135+
* [Rearrangeways](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/rearrangeways.r)
136+
* [Shortest.Common.Supersequence](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/shortest.common.supersequence.r)
137+
* [Unique.Letters.Count](https://github.com/TheAlgorithms/R/blob/HEAD/string_manipulation/unique.letters.count.r)

documentation/ann.html

Lines changed: 83 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -3,146 +3,116 @@
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
6+
<meta name="generator" content="litedown 0.7">
67
<title></title>
78
<style type="text/css">
8-
/**
9-
* Prism.s theme ported from highlight.js's xcode style
10-
*/
11-
pre code {
12-
padding: 1em;
13-
}
14-
.token.comment {
15-
color: #007400;
16-
}
17-
.token.punctuation {
18-
color: #999;
19-
}
20-
.token.tag,
21-
.token.selector {
22-
color: #aa0d91;
23-
}
24-
.token.boolean,
25-
.token.number,
26-
.token.constant,
27-
.token.symbol {
28-
color: #1c00cf;
29-
}
30-
.token.property,
31-
.token.attr-name,
32-
.token.string,
33-
.token.char,
34-
.token.builtin {
35-
color: #c41a16;
36-
}
37-
.token.inserted {
38-
background-color: #ccffd8;
39-
}
40-
.token.deleted {
41-
background-color: #ffebe9;
42-
}
43-
.token.operator,
44-
.token.entity,
45-
.token.url,
46-
.language-css .token.string,
47-
.style .token.string {
48-
color: #9a6e3a;
49-
}
50-
.token.atrule,
51-
.token.attr-value,
52-
.token.keyword {
53-
color: #836c28;
54-
}
55-
.token.function,
56-
.token.class-name {
57-
color: #DD4A68;
58-
}
59-
.token.regex,
60-
.token.important,
61-
.token.variable {
62-
color: #5c2699;
63-
}
64-
.token.important,
65-
.token.bold {
66-
font-weight: bold;
67-
}
68-
.token.italic {
69-
font-style: italic;
70-
}
71-
</style>
72-
<style type="text/css">
739
body {
7410
font-family: sans-serif;
7511
max-width: 800px;
7612
margin: auto;
7713
padding: 1em;
7814
line-height: 1.5;
79-
box-sizing: border-box;
15+
print-color-adjust: exact;
16+
-webkit-print-color-adjust: exact;
8017
}
81-
body, .footnotes, code { font-size: .9em; }
18+
body, .abstract, code, .footnotes, footer, #refs, .caption { font-size: .9em; }
8219
li li { font-size: .95em; }
83-
*, *:before, *:after {
84-
box-sizing: inherit;
85-
}
20+
ul:has(li > input[type="checkbox"]) { list-style: none; padding-left: 1em; }
21+
*, :before, :after { box-sizing: border-box; }
22+
a { color: steelblue; }
8623
pre, img { max-width: 100%; }
87-
pre, pre:hover {
88-
white-space: pre-wrap;
89-
word-break: break-all;
90-
}
91-
pre code {
92-
display: block;
93-
overflow-x: auto;
94-
}
24+
pre { white-space: pre-wrap; word-break: break-word; }
25+
pre code { display: block; padding: 1em; overflow-x: auto; }
9526
code { font-family: 'DejaVu Sans Mono', 'Droid Sans Mono', 'Lucida Console', Consolas, Monaco, monospace; }
96-
:not(pre) > code, code[class] { background-color: #F8F8F8; }
97-
code.language-undefined, pre > code:not([class]) {
98-
background-color: inherit;
99-
border: 1px solid #eee;
100-
}
27+
:not(pre, th) > code, code[class], div > .caption { background: #f8f8f8; }
28+
pre > code:is(:not([class]), .language-plain, .language-none, .plain), .box, .figure, .table { background: inherit; border: 1px solid #eee; }
29+
pre > code {
30+
&.message { border-color: #9eeaf9; }
31+
&.warning { background: #fff3cd; border-color: #fff3cd; }
32+
&.error { background: #f8d7da; border-color: #f8d7da; }
33+
}
34+
.fenced-chunk { border-left: 1px solid #666; }
35+
.code-fence {
36+
opacity: .4;
37+
border: 1px dashed #666;
38+
border-left: 2px solid;
39+
&:hover { opacity: inherit; }
40+
}
41+
.box, .figure, .table, table { margin: 1em auto; }
42+
div > .caption { padding: 1px 1em; }
43+
.figure { p:has(img, svg), pre:has(svg) { text-align: center; } }
44+
.flex-col { display: flex; justify-content: space-between; }
10145
table {
102-
margin: auto;
103-
border-top: 1px solid #666;
46+
&:only-child:not(.table > *) { margin: auto; }
47+
th, td { padding: 5px; font-variant-numeric: tabular-nums; }
48+
thead, tfoot, tr:nth-child(even) { background: whitesmoke; }
49+
thead th { border-bottom: 1px solid #ddd; }
50+
&:not(.datatable-table) {
51+
border-top: 1px solid #666;
52+
border-bottom: 1px solid #666;
53+
}
10454
}
105-
table thead th { border-bottom: 1px solid #ddd; }
106-
th, td { padding: 5px; }
107-
thead, tfoot, tr:nth-child(even) { background: #eee; }
10855
blockquote {
10956
color: #666;
11057
margin: 0;
111-
padding-left: 1em;
112-
border-left: 0.5em solid #eee;
58+
padding: 1px 1em;
59+
border-left: .5em solid #eee;
11360
}
11461
hr, .footnotes::before { border: 1px dashed #ddd; }
11562
.frontmatter { text-align: center; }
116-
#TOC .numbered li { list-style: none; }
117-
#TOC .numbered { padding-left: 0; }
118-
#TOC .numbered ul { padding-left: 1em; }
119-
table, .body h2 { border-bottom: 1px solid #666; }
63+
#TOC {
64+
a { text-decoration: none; }
65+
ul { list-style: none; padding-left: 1em; }
66+
& > ul { padding: 0; }
67+
ul ul { border-left: 1px solid lightsteelblue; }
68+
}
69+
.body h2 { border-bottom: 1px solid #666; }
12070
.body .appendix, .appendix ~ h2 { border-bottom-style: dashed; }
121-
.footnote-ref a::before { content: "["; }
122-
.footnote-ref a::after { content: "]"; }
123-
section.footnotes::before {
124-
content: "";
125-
display: block;
126-
max-width: 20em;
71+
.main-number::after { content: "."; }
72+
span[class^="ref-number-"] { font-weight: bold; }
73+
.ref-number-fig::after, .ref-number-tab::after { content: ":"; }
74+
.cross-ref-chp::before { content: "Chapter "; }
75+
.cross-ref-sec::before { content: "Section "; }
76+
.cross-ref-fig::before, .ref-number-fig::before { content: "Figure "; }
77+
.cross-ref-tab::before, .ref-number-tab::before { content: "Table "; }
78+
.cross-ref-eqn::before, .MathJax_ref:has(mjx-mtext > mjx-c + mjx-c)::before { content: "Equation "; }
79+
.abstract, #refs {
80+
&::before { display: block; margin: 1em auto; font-weight: bold; }
81+
}
82+
.abstract::before { content: "Abstract"; text-align: center; }
83+
#refs::before { content: "Bibliography"; font-size: 1.5em; }
84+
.ref-paren-open::before { content: "("; }
85+
.ref-paren-close::after { content: ")"; }
86+
.ref-semicolon::after { content: "; "; }
87+
.ref-and::after { content: " and "; }
88+
.ref-et-al::after { content: " et al."; font-style: italic; }
89+
.footnote-ref a {
90+
&::before { content: "["; }
91+
&::after { content: "]"; }
92+
}
93+
section.footnotes {
94+
margin-top: 2em;
95+
&::before { content: ""; display: block; max-width: 20em; }
96+
}
97+
.fade {
98+
background: repeating-linear-gradient(135deg, white, white 30px, #ddd 32px, #ddd 32px);
99+
opacity: 0.6;
127100
}
128101

129102
@media print {
130-
body {
131-
font-size: 12pt;
132-
max-width: 100%;
133-
}
134-
tr, img { page-break-inside: avoid; }
103+
body { max-width: 100%; }
104+
tr, img { break-inside: avoid; }
135105
}
136106
@media only screen and (min-width: 992px) {
137-
pre { white-space: pre; }
107+
body:not(.pagesjs) pre:has(.line-numbers):not(:hover) { white-space: pre; }
138108
}
139109
</style>
110+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xiee/[email protected]/css/prism-xcode.min.css">
111+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-core.min.js" defer></script>
112+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/plugins/autoloader/prism-autoloader.min.js" defer></script>
140113
</head>
141114
<body>
142115
<div class="frontmatter">
143-
<div class="title"><h1></h1></div>
144-
<div class="author"><h2></h2></div>
145-
<div class="date"><h3></h3></div>
146116
</div>
147117
<div class="body">
148118
<pre><code class="language-r">library(neuralnet)
@@ -165,11 +135,11 @@
165135
</code></pre>
166136
<pre><code class="language-r">concrete_train&lt;-concrete[1:773,]
167137
</code></pre>
168-
<pre><code>## Error in eval(expr, envir, enclos): object 'concrete' not found
138+
<pre><code>## Error: object 'concrete' not found
169139
</code></pre>
170140
<pre><code class="language-r">concrete_test&lt;-concrete[774:1030,]
171141
</code></pre>
172-
<pre><code>## Error in eval(expr, envir, enclos): object 'concrete' not found
142+
<pre><code>## Error: object 'concrete' not found
173143
</code></pre>
174144
<pre><code class="language-r">concrete_model&lt;-neuralnet(strength~cement+slag+ash+water+superplastic+coarseagg+fineagg+age,data = concrete_train,hidden = 5)
175145
</code></pre>
@@ -181,11 +151,11 @@
181151
</code></pre>
182152
<pre><code class="language-r">x=model_res$net.result
183153
</code></pre>
184-
<pre><code>## Error in eval(expr, envir, enclos): object 'model_res' not found
154+
<pre><code>## Error: object 'model_res' not found
185155
</code></pre>
186156
<pre><code class="language-r">y=concrete_test$strength
187157
</code></pre>
188-
<pre><code>## Error in eval(expr, envir, enclos): object 'concrete_test' not found
158+
<pre><code>## Error: object 'concrete_test' not found
189159
</code></pre>
190160
<pre><code class="language-r">cor(x,y)
191161
</code></pre>
@@ -196,7 +166,5 @@
196166
<pre><code>## Error in plot(concrete_model): object 'concrete_model' not found
197167
</code></pre>
198168
</div>
199-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-core.min.js" defer></script>
200-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/plugins/autoloader/prism-autoloader.min.js" defer></script>
201169
</body>
202170
</html>

0 commit comments

Comments
 (0)