fix: replace c++ with cpp for language postfix

This commit is contained in:
Randell Dawson
2019-06-20 16:00:56 -07:00
committed by Kristofer Koishigawa
parent 7d097e62ac
commit 22f52296bc
11 changed files with 20 additions and 20 deletions

View File

@ -12,7 +12,7 @@ Depth First Search is one of the most simple graph algorithms. It traverses the
### Implementation (C++14) ### Implementation (C++14)
```c++ ```cpp
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <queue> #include <queue>
@ -93,7 +93,7 @@ Worse Case Time Complexity: O(n)
Depth First Search is complete on a finite set of nodes. I works better on shallow trees. Depth First Search is complete on a finite set of nodes. I works better on shallow trees.
### Implementation of DFS in C++ ### Implementation of DFS in C++
```c++ ```cpp
#include<iostream> #include<iostream>
#include<vector> #include<vector>
#include<queue> #include<queue>

View File

@ -108,7 +108,7 @@ public class BubbleSort {
} }
``` ```
### Example in C++ ### Example in C++
```c++ ```cpp
// Recursive Implementation // Recursive Implementation
void bubblesort(int arr[], int n) void bubblesort(int arr[], int n)
{ {

View File

@ -64,7 +64,7 @@ public class Heapsort {
} }
``` ```
Implementation in C++ Implementation in C++
```C++ ```cpp
#include <iostream> #include <iostream>
using namespace std; using namespace std;
void heapify(int arr[], int n, int i) void heapify(int arr[], int n, int i)

View File

@ -11,7 +11,7 @@ To print things to the console, or read from it, you use `cout` and `cin`, which
The "Hello World" program uses `cout` to print "Hello World!" to the console: The "Hello World" program uses `cout` to print "Hello World!" to the console:
```cpp ```cpp
#include<iostream.h> #include<iostream>
using namespace std; using namespace std;
int main() int main()

View File

@ -15,7 +15,7 @@ title: Map
Here is an example: Here is an example:
```c++ ```cpp
#include <iostream> #include <iostream>
#include <map> #include <map>
@ -66,7 +66,7 @@ size of map is 1
## Insertion ## Insertion
Inserting data with insert member function. Inserting data with insert member function.
```c++ ```cpp
myMap.insert(make_pair("earth", 1)); myMap.insert(make_pair("earth", 1));
myMap.insert(make_pair("moon", 2)); myMap.insert(make_pair("moon", 2));
``` ```
@ -114,7 +114,7 @@ value of def is 2
## Accessing map elements ## Accessing map elements
To access map elements, you have to create iterator for it. Here is an example as stated before. To access map elements, you have to create iterator for it. Here is an example as stated before.
```c++ ```cpp
map<char, int>::iterator it; map<char, int>::iterator it;
for(it=first.begin(); it!=first.end(); ++it){ for(it=first.begin(); it!=first.end(); ++it){
cout << it->first << " => " << it->second << '\n'; cout << it->first << " => " << it->second << '\n';

View File

@ -17,7 +17,7 @@ Algumas operações básicas da pilha são:
A implementação de uma pilha é possível usando arrays ou listas vinculadas. A seguir, uma implementação de matriz simples da estrutura de dados da pilha com suas operações mais comuns. A implementação de uma pilha é possível usando arrays ou listas vinculadas. A seguir, uma implementação de matriz simples da estrutura de dados da pilha com suas operações mais comuns.
```C++ ```cpp
//Stack implementation using array in C++ //Stack implementation using array in C++
//You can also include<stack> and then use the C++ STL Library stack class. //You can also include<stack> and then use the C++ STL Library stack class.

View File

@ -37,7 +37,7 @@ A instrução de atualização é usada para alterar a variável de loop usando
## IMPLEMENTAÇÃO: ## IMPLEMENTAÇÃO:
```C++ ```cpp
#include <iostream> #include <iostream>
using namespace std; // Here we use the scope resolution operator to define the scope of the standar functions as std:: using namespace std; // Here we use the scope resolution operator to define the scope of the standar functions as std::

View File

@ -8,13 +8,13 @@ localeTitle: Массивы C ++
Например, массив, содержащий 5 целых чисел (int), объявляется так: Например, массив, содержащий 5 целых чисел (int), объявляется так:
```C++ ```cpp
int numbers [5]; int numbers [5];
``` ```
Начальное заполнение значений при объявлении массива (initializiation): Начальное заполнение значений при объявлении массива (initializiation):
```C++ ```cpp
//Initialization with entries: //Initialization with entries:
int numbers [5] = {1, 2, 3, 4, 5}; int numbers [5] = {1, 2, 3, 4, 5};
@ -34,7 +34,7 @@ int numbers [5];
Элементы из массива можно получить через ссылку на их позицию в массиве. (Отсчет начинается с 0). Элементы из массива можно получить через ссылку на их позицию в массиве. (Отсчет начинается с 0).
Пример: Пример:
```C++ ```cpp
x = numbers[0]; // = 1. [0] == first position x = numbers[0]; // = 1. [0] == first position
numbers[2] = 55; // Sets the third position (3) to the new number 55 numbers[2] = 55; // Sets the third position (3) to the new number 55
//numbers[] is now: {1, 2, 55, 4, 5} //numbers[] is now: {1, 2, 55, 4, 5}

View File

@ -174,7 +174,7 @@ int binarySearch(int a[], int l, int r, int x) {
### Implementación C / C ++ ### Implementación C / C ++
```C++ ```cpp
int binary_search(int arr[], int l, int r, int target) int binary_search(int arr[], int l, int r, int target)
{ {
if (r >= l) if (r >= l)
@ -208,7 +208,7 @@ def binary_search(arr, l, r, target):
### Ejemplo en C ++ ### Ejemplo en C ++
```c++ ```cpp
// Binary Search using iteration // Binary Search using iteration
int binary_search(int arr[], int beg, int end, int num) int binary_search(int arr[], int beg, int end, int num)
{ {
@ -225,7 +225,7 @@ def binary_search(arr, l, r, target):
} }
``` ```
```c++ ```cpp
// Binary Search using recursion // Binary Search using recursion
int binary_search(int arr[], int beg, int end, int num) int binary_search(int arr[], int beg, int end, int num)
{ {

View File

@ -8,13 +8,13 @@ Una matriz es una serie de elementos del mismo tipo de datos que se almacenan en
Por ejemplo, una matriz que contiene 5 valores enteros llamados números se declara así: Por ejemplo, una matriz que contiene 5 valores enteros llamados números se declara así:
```C++ ```cpp
int numbers [5]; int numbers [5];
``` ```
Inicialización: Inicialización:
```C++ ```cpp
//Initialization with entries: //Initialization with entries:
int numbers [5] = {1, 2, 3, 4, 5}; int numbers [5] = {1, 2, 3, 4, 5};
@ -34,7 +34,7 @@ Inicialización:
Se puede acceder a los elementos de una matriz a través de la referencia de su posición en la matriz. (Comience contando desde 0). Se puede acceder a los elementos de una matriz a través de la referencia de su posición en la matriz. (Comience contando desde 0).
Ejemplo: Ejemplo:
```C++ ```cpp
x = numbers[0]; // = 1. [0] == first position x = numbers[0]; // = 1. [0] == first position
numbers[2] = 55; // Sets the third position (3) to the new number 55 numbers[2] = 55; // Sets the third position (3) to the new number 55
//numbers[] is now: {1, 2, 55, 4, 5} //numbers[] is now: {1, 2, 55, 4, 5}

View File

@ -37,7 +37,7 @@ La instrucción de actualización se usa para alterar la variable del bucle medi
## IMPLEMENTACIÓN: ## IMPLEMENTACIÓN:
```C++ ```cpp
#include <iostream> #include <iostream>
using namespace std; // Here we use the scope resolution operator to define the scope of the standar functions as std:: using namespace std; // Here we use the scope resolution operator to define the scope of the standar functions as std::