{"id":18772997,"url":"https://github.com/nimit95/cpp-header","last_synced_at":"2025-04-13T09:05:49.547Z","repository":{"id":124113758,"uuid":"96180578","full_name":"nimit95/cpp-header","owner":"nimit95","description":"C++ header for Data structure","archived":false,"fork":false,"pushed_at":"2017-11-11T16:44:39.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T09:05:43.661Z","etag":null,"topics":["c-plus-plus","cpp","data-structures","linked-list","tree","vector"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nimit95.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-04T05:59:23.000Z","updated_at":"2024-02-08T23:02:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"0636d45d-2d0b-4946-9e21-102d1807398f","html_url":"https://github.com/nimit95/cpp-header","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimit95%2Fcpp-header","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimit95%2Fcpp-header/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimit95%2Fcpp-header/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimit95%2Fcpp-header/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nimit95","download_url":"https://codeload.github.com/nimit95/cpp-header/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248688573,"owners_count":21145766,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-plus-plus","cpp","data-structures","linked-list","tree","vector"],"created_at":"2024-11-07T19:32:08.242Z","updated_at":"2025-04-13T09:05:49.542Z","avatar_url":"https://github.com/nimit95.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++ Header File\nThese are multipurpose header files. These can be used to implement data structures. Useful functions are included with each header file. Some of the header files works faster than internally implemented STL.\n### Requireents\nYour computer should have a working c++ compiler.\n### Getting started\nDownload or clone the repository, copy the required header file to location of your program and then include the header file(s) in your program. Eg. #include \"Hashmap.h\"\n###### nimit.h is main header file which contains the following header files(can be included seperately as well). Header files in it are as follows -\n* [Vector.h](#vectorh)\n* [Stack.h](#stackh)\n* [Linkedlist.h](#linkedlisth)\n* [Trie.h](#trieh)\n* [Hashmap.h](#hashmaph)\n### Vector.h\n#### Constructor\n* **Vector()**  --\u003e  Default constructor. Makes an empty vector.\n\n* **Vector(int)** --\u003e Allocates the given number of buckets in the hash table.\n* **Vector(int, T)** --\u003e  Allocates the given number of buckets in the hash table and specify the load factor as a float value\n* **Vector(vector\u003cT\u003e)** --\u003e Constructor of the class Vector and takes vector as a parameter.\n#### Member Functons\n* **append(vector\u003cT\u003e v)** --\u003e Appends another vector of the same type T.\n* **append(Vector\u003cT\u003e v)** --\u003e Appends another Vector of the same type T.\n* **back()** --\u003e Returns reference to the last element of the vector.\n* **capacity()** --\u003e Returns the size of the storage space currently allocated for the vector, expressed in terms of elements.\n* **erase(string)** --\u003e Erases the corresponding string and key value. Return type- void\n* **find(string)** --\u003e Returns pointer to the value for the give key, if the key is not found return NULL.\n* **operator[\"start:end\"]** --\u003e Returns a sliced Vector from start to end\n* **operator[int]** --\u003e [] can be used to access elements, replace values and add new value\n* **operator+** --\u003e Returns a vector with both vectors appended Eg. v1 + v2  \n* **pop_back()** --\u003e Pops the last element.\n* **print()** --\u003e Prints all the keys in the hashmap.\n* **push_back(T)** --\u003e Inserts a string key and value in the hashmap. Return type is void.\n* **resize()** --\u003e Resizes the vector to the new size given as parameter.\n* **size()** --\u003e Returns the size of the vector.\n* **sortVec()** --\u003e sorts the vector.\n* **take_input(int start,int end)** --\u003e Takes limits as parameter and input elements from (start-end).\n\n\n### Stack.h\n#### Constructor\n* **Stack()**  --\u003e  Default constructor. Makes an empty stack.\n\n#### Member Functons\n* **push(T)** --\u003e Inserts an element at the top the stack.\n* **pop()** --\u003e Remove an element from top of the stack.\n* **top()** --\u003e Returns the element at the top.\n* **size()** --\u003e Returns size of the vector.\n* **empty()** --\u003e Erases the corresponding string and key value. Return type- void\n\n### Linkedlist.h\n#### Constructor\n* **LinkedList()**  --\u003e  Default constructor. Makes an empty stack.\n* **LinkedList(vector\u003cT\u003e)** --\u003e Creates linked list from a vector.\n#### Member Functons\n* **at(int)** --\u003e\n* **erase(int)**\n* **isCircular()** --\u003e prints all the keys in the hashmap.\n* **makeCircular()** --\u003e\n* **mergePoint(LinkedListNode\u003cT\u003e, LinkedListNode\u003cT\u003e)**\n* **operator[]** --\u003e\n* **pushAtBack(T)** --\u003e insert a string key and value in the hashmap. Return type is void.\n* **pushAtFront()** --\u003e returns pointer to the value for the give key, if the key is not found return NULL.\n* **reverse()** --\u003e\n* **rotateRight(int)** --\u003e\n* **size()** --\u003e\n* **swap()** --\u003e Erases the corresponding string and key value. Return type- void\n### Trie.h\n#### Constructor\n* **Trie()**  --\u003e  Default constructor. Makes an empty stack.\n#### Member Functons\n* **insert(string)** --\u003e insert a string key and value in the hashmap. Return type is void.\n* **isPresent(string)** --\u003e returns pointer to the value for the give key, if the key is not found return NULL.\n* **top()** --\u003e prints all the keys in the hashmap.\n\n\n### Hashmap.h\n* Hashmaps are associative containers that store elements formed by the combination of a key value and a mapped value, and which allows for fast retrieval of individual elements based on their keys.  \n\n* This header file implements hashmap with string as the key and any type of value. hashmap is a templated calss.\n    #### Constructor\n    * **hasmap()**  --\u003e  Default constructor. Allocates 7 buckets initially. Load Factor=0.7\n\n    * **hashmap(int)** --\u003e Allocates the given number of buckets in the hash table.\n    * **hashmap(int, float)** --\u003e  Allocates the given number of buckets in the hash table and specify the load factor as a float value\n\n    #### Member Functons\n    * **insert(string, T)** --\u003e insert a string key and value in the hashmap. Return type is void\n\n    * **find(string)** --\u003e returns pointer to the value for the give key, if the key is not found return NULL.\n    * **print()** --\u003e prints all the keys in the hashmap.\n    * **erase(string)** --\u003e Erases the corresponding string and key value. Return type- void\n\n    * **operator[]**--\u003e [] can be used to access elements, replace values and add new value to the pair. \u003cbr\u003e  Eg.\u003cbr\u003e\n    ```cpp\n    hashmap\u003cstring\u003e hm;\n    hm[\"foo\"] = \"bar\"; // assign bar value to foo key\n    cout\u003c\u003chm[\"foo\"]; // will print bar\n    hm[\"foo\"] = \"baaaaar\" // change foo value\n    cout\u003c\u003chm[\"foo\"]; //Will print baaaaar\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimit95%2Fcpp-header","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimit95%2Fcpp-header","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimit95%2Fcpp-header/lists"}