Giter VIP home page Giter VIP logo

hashtable's Introduction

HashTable

learn how to generate different number of id and scores
	for(i=0; i<10;i++){
		int flag = 0;
		Random rand = new Random();
		num = rand.nextInt(10)+1;
	
			for( j=0;j<10;j++){
						
				if(mylist[j] == num){									
					i = i-1;
					flag=1;
					break;					
				}
		
			}
			
			if(flag == 0){
				mylist[i] = num;							
			}
					
		}
how to integrate through a list

this method is from http://crunchify.com/how-to-iterate-through-java-list-4-way-to-iterate-through-loop/

	Iterator iterator_1 = h_set.iterator();
	while (iterator_1.hasNext()){
		Map.Entry whole_map = (Map.Entry)iterator_1.next();
		System.out.print("ID: " + whole_map.getKey());
		System.out.print("   Score is :" +whole_map.getValue());
		System.out.println("   ");
		
	}
how to store id and score arrays into the hash table
	for(i=0;i<10; i++){
	hmap.put(mylist[i],student_socre[i]) ;
	}
how to pass arguments to other classes

The output is like this:

ID:1    Score is :78
ID:2    Score is :92
ID:3    Score is :83
ID:4    Score is :30
ID:5    Score is :77
ID:6    Score is :42
ID:7    Score is :53
ID:8    Score is :11
ID:9    Score is :42
ID:10    Score is :53

hashtable's People

Contributors

qrslrhko avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.