Add anything about data structure and algorithm in any language.

Overview

Hacktoberfest 2021

Follow the README below to get started!

Note : This repo is excluded from the Hacktoberfest but you can still contribute and the reason is importance of DSA, yourcontribution will be for lifelong.

Table of contents

Getting Started

Before you begin, please follow my other account and contribute to projects over there.

The Process

  1. Fork this repository
  2. Run git clone [your repo url goes here]
  3. CD into your cloned repo
  4. Run git checkout -b [your branch name goes here] to create your new branch
  5. Make your edits and save
  6. Run git add .
  7. Run git commit -m 'Commit message goes here'
  8. Finally, run git push origin [your branch name goes here]
  9. Star this repo
  10. Create a new pull request from your forked repository (Click the New Pull Request button located at the top of your repo)
  11. Wait for your new PR to be reviewed and merged!
Issues
  • Create bubble sort algorithm

    Create bubble sort algorithm

    add the bubble sort algorithm which is most common sorting algorithm time complexity of bubble sort is O(n²) in the average and worst cases – and O(n) in the best case

    opened by brat-blip 1
  • Create bubble sort algorithm

    Create bubble sort algorithm

    this code is of bubble sort algorithm which is most common sorting algorithm time complexity of bubble sort is O(n²) in the average and worst cases – and O(n) in the best case

    opened by brat-blip 1
  • Hash_Table.cpp

    Hash_Table.cpp

    #include

    using namespace std;

    class hash_table //Class hash_table created { public:

    int table_hash[50];			//Array Creation
    int table_hash_size;		//Create hash value size
    int ctr;
    hash_table(int n)
    {
        table_hash_size =8;
        ctr = 0;
        for(int i=0;i<table_hash_size;i++)		//increment hash table index as elements are inserted
        {
            table_hash[i] = -1;
        }
    }
    void store_value_linear_probin_with_replacemet(int value);					//Function Declaration
    int calculate_hash_value(int value);
    int search_value_in_hash_table_hash_linear_probing(int value);
    void display_hash_table_hash_linear_probing();
    

    };

    int hash_table::search_value_in_hash_table_hash_linear_probing(int value) //Search Hash table with Linear Probing Function { int hashvalue = calculate_hash_value(value); //Variable Declaration display_hash_table_hash_linear_probing(); if(table_hash[hashvalue] == value) //if else statement { cout<<endl<<"Given value "<<value<<" is stored at location "<<hashvalue<<" in hash table"; return hashvalue; } else { ctr = 1; int flag = 0; while(1) { hashvalue = (hashvalue + 1) % table_hash_size; //check for next hash location to match with given hash value if(ctr == table_hash_size) //if matches with hash value { flag = 0; break; } else if(table_hash[hashvalue] == value) { flag = 1; break; } else if(table_hash[hashvalue] == -1) //if element not present in hash table { flag = 2; break; } } if(flag == 0) //if else statement { cout<<endl<<"Given value "<<value<<" is stored at location "<<hashvalue<<" in hash table"; return -1; } else if(flag == 1) { cout<<"\nGiven value "<<value<<" is stored in hash table at location : "<<hashvalue; return hashvalue; } else if(flag==2) { cout<<"\nHash Value Not found"; } } }

    int hash_table::calculate_hash_value(int value) //Calculate Hash value function { return value%8; }

    void hash_table::store_value_linear_probin_with_replacemet(int value) //Store Hash value with replacement Function { int hashvalue = calculate_hash_value(value); //calcuate hash value //if the location is empty if(table_hash[hashvalue] == -1) //if else statement { table_hash[hashvalue] = value; //if value to inserted that hash value location is empty,then insert it in hash location ctr++; //increment counter } else { int flag = 0; // from next location onward search linearly to find the empty location int temp_hash_value = calculate_hash_value(table_hash[hashvalue]); //store that hash value in temp variable if(temp_hash_value == hashvalue) //if else statement { while(1) { hashvalue = (hashvalue + 1) %table_hash_size; //calcuate immediate next hash value location if(table_hash[hashvalue] == -1) //if that hash value location is empty { flag = 1; //flag as 1 break; } else if(ctr == table_hash_size) //if hashtable is full { cout<<"\n Hash table is full with 8 Values"; flag = 0; break; } } if(flag == 1) //add that element to next hash location { table_hash[hashvalue] = value; ctr++; } } //replace data else //else replace existing element in that hash location to next immediate location and insert required value at that hash location { int temp_value = table_hash[hashvalue]; table_hash[hashvalue] = value; while(1) { hashvalue = (hashvalue + 1) %table_hash_size; //calcuate immediate next hash value location if(table_hash[hashvalue] == -1) //check if that location is empty { flag = 1; break; } else if(ctr == table_hash_size) //if table is full { cout<<"\n Hash table is full with 8 Values"; flag = 0; break; } } if(flag == 1) //insert hash value { table_hash[hashvalue] = temp_value; ctr++; } } } display_hash_table_hash_linear_probing(); }

    void hash_table::display_hash_table_hash_linear_probing() //Display Hash table linear probing Function { cout<<endl<<"Hash Table:-"; for(int i=0;i<table_hash_size;i++) { cout<<endl<<" "<<i<<" "<<table_hash[i]; } }

    int main() //Main Function {

    hash_table h(10);									//Object Created
    int ch,ch1,choice, value;					//Variable Declaration
    cout<<"<---------------Welcome to Balu's Ice-Cream Parlour--------------->";
    do																					//do while statement
    {
    	cout<<"\n\n1.Insert Flavour_ID\n2.Search Flavour\n3.Display Flavour\n4.Exit\n";
        cout<<"\nEnter your choice:-\n";
        cin>>ch;
        cout<<endl;
    	switch(ch)																										//switch case statement
    {
    	case 1:																										//Case 1 
    	{
    		if(ch==1)
    		{
    			
    				while(1)
        			{
            		cout<<"\n Enter the Flavour_ID : ";
            		cin>>value;
    		        h.store_value_linear_probin_with_replacemet(value);
    		        cout<<"\n Do you want to continue (1/0) : ";
    		        cin>>choice;
    		        if(choice == 0)
    		        break;
        			}
    			}
    		}
    	break;
    	case 2:																				//Case 2
    	{		
    		int ch2,val;
    	    	while(1)
    			    {
    			        cout<<"\n Enter the Flavour_ID to be searched: ";
    			        cin>>val;
    			        h.search_value_in_hash_table_hash_linear_probing(val);
    			        cout<<"\n Do you want to search other value (1/0) : ";
    			        cin>>ch2;
    			        if(ch2 == 0)
    			        break;
    			    }
    			break;    
    	    }
    	    
    	case 3:																	//Case 3
    	{	
    		if(ch==3)
    			h.display_hash_table_hash_linear_probing();
    	}
    	break;
    	case 4:														//Case 4
    		exit(0);		
    }
    }while(ch!=4);
    

    return 0; }

    opened by PrajwalDev9 1
Contribute a Data Structure you coded or solve the problems given in the Description.md file in any language! Happy coding!

Pro Lang Contribute a Data Structure you coded or solve the problems given in the Description.md file (can be found in the both the folders) in any la

IEEE-IAS VIT 1 Jan 16, 2022
Add a code in any language

Hii I AM SHAMIL THOMAS & I WELCOME YOU TO HacktoberFest 2021 Give a star to the repository if you like it ⭐ Add a code in any language ❓ What's Hackto

null 25 May 28, 2022
Add virtual monitors to your windows 10 device! Works with Oculus software, obs, and any desktop sharing software

License MIT and CC0 or Public Domain, whichever is least restrictive -- Use it AS IS - NO IMPLICIT OR EXPLICIT warranty This may break your computer,

Rashi Abramson 166 Jun 28, 2022
A beginner friendly repo in the world of open source. Contribute here to add here project in any languages.

Hacktober Fest 2021 Heyy There (●'◡'●) Here you can contribute to opensource project in any valid language and project. Just follow the contribution g

Anonymous-inception 6 May 24, 2022
Any one can add their programs here ,but program should not be repeated.

Hactoberfest2021 To All the Beginners Guys Don't Forget to give star to this repo. Any one can add their programs here ,but program should not be repe

Varun.py 22 Jun 12, 2022
Add a command interpreter (eg., REPL) to any C++ program

Command Interpreter This header-only library makes it easy to add command evaluation to a C++ program. #include "command_interpreter.hpp" class Arith

Empirical Software Solutions, LLC 405 Jun 8, 2022
Create a calculator of any kind in any language, create a pr.

calculators Create a calculator of any kind in any language, create a pr. Create a calculator of any type using the programming language of your choic

Akshay Gautam 2 Dec 1, 2021
Treexy is a library that implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized on a three-dimensional grid

Treexy is a library that implements a compact hierarchical data structure that can store and manipulate volumetric data, discretized on a three-dimens

Davide Faconti 241 Jun 24, 2022
Just getting started with Data Structure and Algorithms? Make your first contribution here and start the journey of learning DSA.

Getting Started ! ✨ If you are just beginning with open source then let's make your first contribution in this repository ! Contributing Tutorial ?? P

amega 3 Apr 18, 2022
HESS (Hyper Exponential Space Sorting) is a polynomial black-box optimization algorithm, that work very well with any NP-Complete, or NP-Hard problem

The original HESS (Hyper Exponential Space Sorting) is a polynomial black-box optimization algorithm, that work very well with any NP-Complete, or NP-Hard problem, at 2021 thanks to suggestions of Daniel Mattes, work like a complete algorithm.

SAT-X 3 Jan 18, 2022
Implementation and tutorial for a dynamic vector data-structure in C.

Vec: A Dynamic Vector in C The subject.md file contains exercises for this implementation if you want to do it yourself. In that case, don't peek at t

Julius Koskela 28 Jun 25, 2022
OpenVDB - Sparse volume data structure and tools

OpenVDB AX Nano Houdini Website | Discussion Forum | Documentation OpenVDB is an open source C++ library comprising a novel hierarchical data structur

Academy Software Foundation 1.7k Jun 23, 2022
Loads a signed kernel driver which allows you to map any driver to kernel mode without any traces of the signed / mapped driver.

CosMapper Loads a signed kernel driver (signed with leaked cert) which allows you to map any driver to kernel mode without any traces of the signed /

null 107 Jul 2, 2022
Automatically load dlls into any executables without replacing any files!

Automatically loaded dll using xinput9_1_0 proxy. Please put the modified xinput9_1_0.dll in the executable's directory.

null 11 Apr 17, 2022
Grand Programs for every Data Structure including all their operations

Grand-Programs-UE20CS203 Grand Programs for every Data Structure including all their operations Some idioms that I use, so you won't get confused I pr

Aditya Rao 1 Apr 1, 2022
CSE2122: Data Structure Lab

CSE2122: Data Structure Lab Array Traversing Inserting (int) Inserting (string) Deleting Sorting (Bubble sort: int type data) Sorting (Bubble sort: st

Fahim Ahammed Firoz 12 Feb 28, 2022
Add tensilica esp32 cpu and a board to qemu and dump the rom to learn more about esp-idf

qemu_esp32 Add tensilica esp32 cpu and a board to qemu and dump the rom to learn more about esp-idf ESP32 in QEMU. This documents how to add an esp32

null 333 Jun 22, 2022