Lengkap

I need a code in c++ about reading a text file into a hash table. (the content of the text file is integer). By assigning the line number to be the key and line contents into an array. After that do the comparison as described in the body.

I have a file of 5MB and I want to hash it to hash table. It is integers where the key is the line number and the value is an array of the content in that line. The data in the file looks like this.

key = 1 Neighbors 1 3 5

key = 2 Neighbors 2 4 5

key = 3 Neighbors 3 2 1

key = 4 Neighbors 6 4 2

1 3 5

2 4 5

3 2 1

6 4 2

So, for first line Key = 1, and Value = {1,3,5} The problem is that I want the line number to be my key and the data to be in an array.

I want to store this file in a hash table. Then running nested loops where it iterate through all keys (number of lines), for each key retrieve the value (set of Neighbors S[]), For each neighbor s in S do retrieve all lines that match with neighbors. Then check if line x is in the Neighbors of these Neighbors. If yes True++, if no False++.

Assume k =3

The file looks like that

X_1 X_2 X_3

Read 3-NN file into hashtable

Hash-table T=<key,value>

Key = B = line number

Value = {X_1, X_2, X_3}

Next run the following nested loop

True=0; False = 0;

iterate through all keys in T

for each key s belong to S retrieve the set of Value (in the example above S={X_1, X_2, X_3})

For each Value X_i do

let the Value X_i be the Key and retrieve all retrieve sets

( so it will return the Value of line X_1 and line X_2 and line X_3)

Check if B is in Value is in the retrieve sets.

True ++;

else

False ++;

Summary

Each line is a point and the line content is the neighbors. For a point x that has X_i neighbors

checking is X_i neighbors considering x from their neighbors. if yes increas true if no increase false.

I did it in a two dimensional matrix and it works fine but my data is huge so matrix is not a good solution.

As shown in the attached file.

Kemahiran: Pengaturcaraan C++

Lihat lagi: searching in file handling in c++, getline c++, c++ read text file line by line, online c compiler, c++ reading data from text file into an array, c++ programming exercises and solutions pdf, online c++ compiler, file streams in c++, sugarcrm key number, sample java program array getting minimum number, code converting bmp file dimensional rgb array, magento constraint fk_sales_order_customer foreign key customer_id references customer_entity entity_id delete set null update c, protectmac product license key number, write program takes command line argument text file creates text file heading line contents original file line numbers added , write program takes command line argument text file creates text file heading line file contents original file line numbers adde, char array subtract big number, mips number times integer appears array, generate registration key number days, c code to write excel rows from a nested array, c# code to write excel rows from a nested array

Tentang Majikan:
( 1 ulasan ) Riyadh, Saudi Arabia

ID Projek: #27920884

Dianugerahkan kepada:

gusteyag

Hello. I read your description and need more information to clear understand (about cycle). I have 12+ years of experience in programming amd can do your task qualitatively.

$50 USD dalam sehari
(10 Ulasan)
4.7

13 pekerja bebas membida secara purata $120 untuk pekerjaan ini

harissheikh255

Hi, I find my self as perfect person for this work. This is hashing with chaining concept(u can search it) of which u are describing. I can do it for u in simplest coding and shortest time. I have done many C++ works Lagi

$50 USD dalam sehari
(43 Ulasan)
5.0
JaT83

Dear, sir. I'm very glade to get a chance i bid your task. I'm an expert in c/c++ and debugging I have a lot of experiences in this aspect 8+ years. If you hire me, you 'll get a good result in a short time at raw cos Lagi

$149 USD dalam 7 hari
(3 Ulasan)
3.8
natapataykina02

Hello,your project is very motivated for me. As a senior developer, I have rich experience in c,c++for over 8+ years. i can start [login to view URL] ping me

$180 USD dalam sehari
(5 Ulasan)
2.8
Geiler

Hi! I can help you. I'm expert in c/c++..................................................................................

$111 USD dalam sehari
(4 Ulasan)
2.7
WizardWD

Hi Thanks for explaining the project in detail. The project could be completed in one day. Kind Regards

$30 USD dalam 7 hari
(7 Ulasan)
2.7
mikeitexpert

Dear Employer, I have extensive experience in C/C++ programming and I can implement your task in shortest time possible. Please let me know if you are interested and I would be more than happy to assist you.

$39 USD dalam 2 hari
(4 Ulasan)
2.0
oleksandr19za

Greetings! I am strong in math and algorithms, C++,C#<python expert. hash tables, sorting, data structures are so confident for me. thanks.

$100 USD dalam sehari
(0 Ulasan)
0.0
roddon56pomidon9

Hi I'm a desktop application expert, with over 4 years experience dealing with MFC, Qt, Algorithm, File compressing, OpenCV and so on. I have also rich experience with the CodeChef contest. I understand your requireme Lagi

$250 USD dalam sehari
(0 Ulasan)
0.0
sdlances

Hi, I’m and experienced C++ developer and have hands on experience working on various data structures/algorithm projects. I can start immediately and can complete your project in a couple of days. Let me know further Lagi

$120 USD dalam 2 hari
(0 Ulasan)
0.0
technorizen11

Hello. How about today? High-quality & Fast-delivery is promised! As a highly skilled Full-Stack developer and I can help you perfectly. I am very confident with my skills and I'd like to help your business by doing my Lagi

$225 USD dalam 7 hari
(0 Ulasan)
0.0
igor7stepanov20

Hello. Thanks for your job posting. I have rich experience in C/C++ Programming, Data Structure & Algorithms. I have checked your requirements and attached file carefully. I can satisfy your requirements perfectly! We Lagi

$140 USD dalam 2 hari
(0 Ulasan)
0.0
yufaustoithk

Hello! I read your job posting carefully and I am very interested in your project. I am a developer with great experience and skills in C/C++ programming for over 11 years. I always give clients satisfaction with the Lagi

$120 USD dalam 2 hari
(0 Ulasan)
0.0