/C-Playground

A Repo for C++ Concepts and Programs.

Primary LanguageC++

C---Playground

A Repo for C++ Concepts and Programs.

Why C++?

As of September 2020, C++ is the fourth most popular programming language globally behind C, Java and Python, and – according to the latest TIOBE index – is also the fastest growing.
In any large system, you typically find C++ in the lower-level and performance-critical parts. Such parts of a system are often not seen by end-users or even by developers of other parts of the system, so I sometimes refer to C++ as an invisible foundation of everything.

Philosophy from Wikipedia

🔸It must be driven by actual problems and its features should be immediately useful in real world programs.
🔸Every feature should be implementable (with a reasonably obvious way to do so).
🔸Programmers should be free to pick their own programming style, and that style should be fully supported by C++.
🔸Allowing a useful feature is more important than preventing every possible misuse of C++.
🔸It should provide facilities for organising programs into separate, well-defined parts, and provide facilities for combining separately developed parts.
🔸No implicit violations of the type system (but allow explicit violations; that is, those explicitly requested by the programmer).
🔸User-created types need to have the same support and performance as built-in types.
🔸Unused features should not negatively impact created executables (e.g. in lower performance).
🔸There should be no language beneath C++ (except assembly language).
🔸C++ should work alongside other existing programming languages, rather than fostering its own separate and incompatible programming environment.
🔸If the programmer's intent is unknown, allow the programmer to specify it by providing manual control.

Reading and Writing to a File

#include<stdio.h>
#include<stdlib.h>

int main(){
    
    FILE* inputFile,*outputFile;
    double number;
    char ch;
    
    inputFile = fopen("input.dat","r");
    if(inputFile==NULL){
        perror("Error in Opening the File");
        return 1;
    }

    // Open the Output FIle for Writing
    outputFile=fopen("output.dat","w");
    if(outputFile==NULL){
        perror("Error opening the output file");
        fclose(inputFile);
        return 1;
    }


    while(fscanf(inputFile,"%lf",&number)==1){
        // Write your function to compute on numbers
        // solve()

        fprintf(outputFile,"%.2lf\n",result);
    }

    fclose(inputFile);
    fclose(outputFile);

    printf("Computation COmpleted");
    return 0;
}

Some Important PDF's

🌟Flowcharts: https://github.com/amazon01FireStick/OnlyPictures/blob/main/flow%20charts.pdf
🌟Installation of CodeBlocks: https://github.com/amazon01FireStick/OnlyPictures/blob/main/installation.pdf
🌟Getting Started with C++: https://github.com/amazon01FireStick/OnlyPictures/blob/main/starting.pdf
🌟Conditionals and Loops: https://github.com/amazon01FireStick/OnlyPictures/blob/main/loops.pdf
🌟Patterns: https://github.com/amazon01FireStick/OnlyPictures/blob/main/pattern.pdf
🌟Operators,Scope of Variables,Loops: https://github.com/amazon01FireStick/OnlyPictures/blob/main/operators.pdf
🌟Functions in C++ : https://github.com/amazon01FireStick/OnlyPictures
⭐Array Important Gists: https://gist.github.com/geeky-auro/bdb1512fa2c58f7c6e52ae615cb9cfe3
🌟Arrays: https://github.com/amazon01FireStick/OnlyPictures/blob/main/arrays.pdf
🌟Searching and Sorting: https://github.com/amazon01FireStick/OnlyPictures/blob/main/Searching%20and%20Sorting%20Algorithm.pdf
🌟cin.getline()- https://www.geeksforgeeks.org/getline-string-c/
🌟Characters and 2D Arrays- https://github.com/amazon01FireStick/OnlyPictures/blob/main/characters%20and%202D%20Arrays.pdf

Some Important Gists

🌟Diamond Pattern: https://gist.github.com/geeky-auro/e2b747dc7ce4b77b298d5275a541f3f9
⭐cin.get()- https://gist.github.com/geeky-auro/37dcc6df57abfaf5ac4983886b46715c
🌟Sum or Product- https://gist.github.com/geeky-auro/3041f696175b823ae155bca4c96a17c9
🌟Terms of AP- https://gist.github.com/geeky-auro/c3857ba1f1584e772753aad22c4eca55
⭐Reverse of a number- https://gist.github.com/geeky-auro/85da337aa087218d734c22446ed47adf
🌟Binary to decimal- https://gist.github.com/geeky-auro/8a883bf5d0f63987348d72c4d923aa38
🌟Decimal to Binary- https://gist.github.com/geeky-auro/7bb66b36bae3210e0b7c9e29b7e7376a
🌟Square Root (Integral)- https://gist.github.com/geeky-auro/67a8bb9a39d2857bbb44cd5e3e64472b
⭐Combinations(nCr)- https://github.com/geeky-auro/C-Playground/blob/main/functions/main.cpp
🌟Member of Fibonacci- https://gist.github.com/geeky-auro/5992602f14ebdbccb24a77dc74dc055f
⭐Array Sum- https://gist.github.com/geeky-auro/4dd6617a3fdf6be5c2b6003da6ac8788
⭐Arrange Numbers in Array- https://gist.github.com/geeky-auro/34ab91a8dc6fab23aaae3d1d57142560
🌟Swap Alternate- https://gist.github.com/geeky-auro/a2f14a931e05bc3bc53316b0afa4e7dc
🌟Find Unique- https://gist.github.com/geeky-auro/aa77039fa4c4b433fb880ce2bc023e0b
⭐Find Duplicate- https://gist.github.com/geeky-auro/7d32ab2b726bf0d58ef472c7842e0f75
🌟Intersection of Two Arrays II- https://gist.github.com/geeky-auro/97f8558a1e7c3c60f9b05b158f70e716
🌟Pair Sum- https://gist.github.com/geeky-auro/391f92e9539a2ff10a822050ec858258
🌟Triplet Sum- https://gist.github.com/geeky-auro/496d753557da13373d58cc6eb03615c3
⭐Length Of a String- https://gist.github.com/geeky-auro/f38306264c5c64a305f5e29305217d7c
⭐Check String Palindrome - https://gist.github.com/geeky-auro/bd2f5db787e398578f0218ad3da111ff
⭐Replace Character- https://gist.github.com/geeky-auro/ee276a2ead128a5b9934388f005f2e91
⭐Trim Spaces- https://gist.github.com/geeky-auro/45697b5613984729622704f3d3efab88
⭐Reverse Word Wise- https://gist.github.com/geeky-auro/8d66654079dafddec4cfa3c511e4e27c
🌟Print All Substrings- https://gist.github.com/geeky-auro/186be106ffd21e3253411df9899bc7d2
⭐Column Wise Sum- https://gist.github.com/geeky-auro/8e2ff6c0ac065b2a534fc17a16ae9fff
⭐Print 2D Array- https://gist.github.com/geeky-auro/4a42ffe3e616914d7b3febf09b990e92
🌟Largest Row or Column- https://gist.github.com/geeky-auro/0478deecb312a179da2e3de62395a925
⭐Wave Print- https://gist.github.com/geeky-auro/4dacf06fc71fcd566d5b6c2c7ca144c7
🌟Check Permutation- https://gist.github.com/geeky-auro/05dff08438fe744d005c4bde1b1e0e88
🌟Remove Consecutive Duplicates- https://gist.github.com/geeky-auro/1cdcf7b3d8c9a2c95bc0de736e4e672c
🌟Reverse Each Word- https://gist.github.com/geeky-auro/b8c979c9490a88bcec6dcaf52da588cd
🌟Remove character- https://gist.github.com/geeky-auro/f1ba2240cc2ae0259c754010ae5cf15b
🌟Highest Occuring Character- https://gist.github.com/geeky-auro/d201f6d0955d5d5ecba8c01840297751
🌟Compress the String- https://gist.github.com/geeky-auro/564b5513cf2300bfd14853d31a11435b
🌟Minimum Length Word- https://gist.github.com/geeky-auro/9cfe0e0ad8bd22a9437796ee2da08ed7
⭐Leaders in array- https://gist.github.com/geeky-auro/113a8a319a0a95931ebba55d29f0aea1

Side Notes

✨2D Arrays➖ https://gist.github.com/geeky-auro/40c724eaea1fab15213a465f6620880d
✨STL in C++➖ https://gist.github.com/geeky-auro/05c7dad534855a194f2ee3119da50df0
🌟Pointers in CPP➖ https://onlinegdb.com/Hfl8sqfSp 🌟Dynamic Allocation ➖ https://onlinegdb.com/tN-Gfv1K-

Searching and Sorting

🌟Sort 0 1- https://gist.github.com/geeky-auro/5037ea51cac378ae50439f7bedae3458
⭐Linear Search- https://gist.github.com/geeky-auro/c798d745d2341df42070b1a8e5f4cf3f#file-linear_search-cpp
🌟Binary Search- https://gist.github.com/geeky-auro/d3cf298bab34140802eae93e299b631e
🌟Selection Sort- https://gist.github.com/geeky-auro/0a8750b424a38235805a8efbe3e26f52
🌟Bubble Sort- https://gist.github.com/geeky-auro/4083081f2fe43266e0956cce343f166c
🌟Insetion Sort- https://gist.github.com/geeky-auro/dee397206eda15c2ba67dc4c70b7648a
🌟Merge Sort- https://github.com/geeky-auro/C-Playground/blob/main/Recursion/mergesort.cpp
🌟Code Merge Two Sorted Arrays- https://gist.github.com/geeky-auro/2f1523aaef82a921a47f92d73c301a27
🌟Push Zeros to end- https://gist.github.com/geeky-auro/65841ff318486602431adc66a794a6a5
🌟Rotate array- https://gist.github.com/geeky-auro/a85eb25383285799566d07385d6b806c
🌟Check Array Rotation- https://gist.github.com/geeky-auro/0c4a4650c3bdd1378d32230930457b70
🌟Sort 0 1 2- https://gist.github.com/geeky-auro/689bfecfcf870357e87898a759846308

DSA

Some Important PDF's

🌟Pointers in CPP: https://github.com/geeky-auro/C-Playground/blob/main/Final%20test/pointersincpp.pdf
🌟Dynamic Allocation in C++ : https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Dynamic%20Allocation.pdf
🌟Intro to Recursion: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/recursion.pdf
🌟Recursion: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Recursion-1%20PDF.pdf
🌟Time and Space Complexity: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Time%20and%20Space%20Complexity.pdf
🌟OOPS 1: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/OOPS%201.pdf
🌟OOPS 2: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/OOPS%202.pdf
🌟Linked List: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Linked%20List.pdf
🌟Linked List-2: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Linked%20List2.pdf
⭐ADT: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/ADT.pdf
⭐Templates: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Templates.pdf
⭐Stack: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Stack.pdf
🌟Queue: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Queues.pdf
⭐Trees: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Trees.pdf
⭐Vectors: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Vectors.pdf
🌟Binary Trees: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Binary%20Trees.pdf
🌟Priority Queues: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/PriorityQueue_Notes.pdf
🌟HashMaps: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/HashMaps.pdf
🌟Trie and Huffman Coding: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Trie%20and%20Huffman%20Coding.pdf
🌟Dynamic Programming: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Dynamic%20Programming%20-1.pdf
🌟Dynamic Programming 2: https://github.com/geeky-auro/C-Playground/blob/main/PDf's/DP-2.pdf
🌟Rat in the Maze - BackTracking ;) https://github.com/geeky-auro/C-Playground/blob/main/PDf's/Rat%20in%20the%20Maze%20-%20Backtracking.pdf
🌟Graph - https://github.com/geeky-auro/C-Playground/blob/main/PDf's/graph_2.pdf

Test

🌟 Assigment-3 : https://github.com/geeky-auro/C-Playground/tree/main/Test%20LL%20and%20Stacks

Recursion

⭐Power- https://gist.github.com/geeky-auro/b15470e15bb5f4544c96eef51f0de47d ⭐Print Numbers- https://gist.github.com/geeky-auro/c938f8a811aa5cc2dbf0583904348307 🌟Recursion Repo- https://github.com/geeky-auro/C-Playground/tree/main/Recursion

Additional Questions for Practice:-

🖋Binary Search: https://www.hackerearth.com/practice/algorithms/searching/binary-search/practice-problems/
🖋Sorting: https://www.hackerearth.com/practice/algorithms/sorting/bubble-sort/tutorial/

Important Coding Questions:-

🌟Second Largest- https://gist.github.com/geeky-auro/179b7af8535bf640524d90c3f39320cc
🌟Check Number sequence- https://gist.github.com/geeky-auro/8306f5d133c207d400e1d9defe8378b9
🌟Sum of Two Arrays- https://gist.github.com/geeky-auro/6c998d3477eef684d850c64050643e39

🔴Spiral Print- https://gist.github.com/geeky-auro/81010633ff6cd7d698e0c86e146f7671

Certificate:-

📜Certificate of Completion: https://github.com/amazon01FireStick/OnlyPictures/blob/main/CN_Certificate_2807b1322734bdaa.pdf
📜Certificate of Excellence: https://github.com/amazon01FireStick/OnlyPictures/blob/main/CN_Certificate_b815f24fef97cd3e.pdf