Está en la página 1de 4

Hashing in C Language http://www.adiwebs.

com/hashing-in-c-language/

Search Custom Search

Home
Cell Phones
GNU/Linux
Google
Laptops
Software
Tips and Tricks
Windows 7

Written on November 4, 2009 at 12:47 pm by Admin

Hashing in C Language
Filed under Programming Languages no comments

Question. What is meant by hashing in C language?

Answer.

Hashing is the transformation of a string of characters into a usually shorter


fixed-length value or key that represents the original string. Hashing is used to
index and retrieve items in a database because it is faster to find the item
using the shorter hashed key than to find it using the original value. It is also
used in many encryption algorithms.

Here are some of the common hash functions that are used in C programming :

Digit rearrangement: This is simply taking part of the original value or key
such as digits in positions 3 through 6, reversing their order, and then using
that sequence of digits as the hash value or key.

The division-remainder method: The size of the number of items in the table
is estimated. That number is then used as a divisor into each original value or
key to extract a quotient and a remainder. The remainder is the hashed value.

1 of 4 Thursday 26 August 2010 05:23 PM


Hashing in C Language http://www.adiwebs.com/hashing-in-c-language/

(Since this method is liable to produce a number of collisions, any search


mechanism would have to be able to recognize a collision and offer an alternate
search mechanism.)

Radix transformation: Where the value or key is digital, the number base (or
radix) can be changed resulting in a different sequence of digits. (For example,
a decimal numbered key could be transformed into a hexadecimal numbered
key.) High-order digits could be discarded to fit a hash value of uniform length.

Folding: This method divides the original value (digits in this case) into
several parts, adds the parts together, and then uses the last four digits (or
some other arbitrary number of digits that will work ) as the hashed value or
key.

- C Interview Questions -

Related Posts:

Numbering Systems
Representation of real numbers in different number systems
Fixed Point Division
Types of Constants in C++
Keywords and Identifiers in C++

Flowcharts from C/C++


Understand code in less time code-formatting,
cross-reference
www.sgvsarc.com
XIIth Board Exams Over?
Join Career Oriented GNIIT Program & Get the
Best Career Opportunity
NIITProfessional.com/Professional
Experienced C engineer?
Deep back-end experience needed. Hottest web
startup in Delhi
www.slideshare.net
Job Openings in C++ Linux
Exp: 0 to 13 Yrs.Sal: 25k to 95k PM Apply Now &
get Multiple Interviews
TimesJobs.com/C++_Linux

← Next post Previous post →

Subscribe / Share

2 of 4 Thursday 26 August 2010 05:23 PM


Hashing in C Language http://www.adiwebs.com/hashing-in-c-language/

Article by Admin

Authors bio is coming up shortly. Read 522 articles by Admin

It's very calm over here, why not leave a comment?

Leave a Reply

You must be logged in to post a comment.

Experienced C engineer?
Deep back-end experience needed. Hottest web
startup in Delhi
www.slideshare.net

Job Openings in C++ Linux


Exp: 0 to 13 Yrs.Sal: 25k to 95k PM Apply Now &
get Multiple Interviews
TimesJobs.com/C++_Linux

Love to Code?
Compete against other coders 24x7 C, Java,
PHP, Perl, Ruby and more!
www.CodeChef.com

Categories

Apple
Apple iPod
Cell Phones
Computer
Computer History
Computer Memory
Gmail
GNU/Linux
Google
Internet Tools
Language Tools
Laptops
Microprocessors
Microsoft Zune
Motherboards
Mozilla Firefox

3 of 4 Thursday 26 August 2010 05:23 PM


Hashing in C Language http://www.adiwebs.com/hashing-in-c-language/

MS Office
Netbooks
Other Stuff
Programming Languages
Security
Software
Spyware
Tips and Tricks
Windows 7
Xbox 360

Recent Posts

Best Way to Create a Website


HTC Desire Hits Indian Shores
Keyboard With New Rupee Sign Arrives
Manage Your Ebooks With FBReader
ASUS U43Jc Bamboo Notebook Launched in India
Windows 7-Powered ASUS Phone Surfaces
Internet Addicts More Likely to Get Depressed
India Unveils Supercomputer ‘Annapurna’
Nokia X6 Cell Phone
Apple sued over iPad overheating

Programming Tutorials

Core Java Tutorials


Advanced Java Programming
Visual Basic .NET

Computers | Gadgets | Cell Phones | Software Reviews is proudly powered


by WordPress. Entries (RSS) and Comments (RSS) | Swift by Satish
Gandham a product of SwiftThemes.Com

4 of 4 Thursday 26 August 2010 05:23 PM

También podría gustarte