This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Stack - Array based implementation. | |
| // Creating a stack of integers. | |
| #include<stdio.h> | |
| #define MAX_SIZE 101 | |
| int A[MAX_SIZE]; // integer array to store the stack | |
| int top = -1; // variable to mark top of stack in array | |
| // Push operation to insert an element on top of stack. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Queue - Circular Array implementation in C++*/ | |
| #include<iostream> | |
| using namespace std; | |
| #define MAX_SIZE 101 //maximum size of the array that will store Queue. | |
| // Creating a class named Queue. | |
| class Queue | |
| { | |
| private: | |
| int A[MAX_SIZE]; |