TCS Papers: Sample Questions 406 - 408 of 502

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 406

» Basic CS » Data Structures

Essay Question▾

Describe in Detail

What is hash table?

Explanation

  • A hash table (hash map) is a data structure, which implements an associative array abstract data type- mapping keys to values.

  • A hash table uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be found.

  • In hashing, large keys are converted into small keys by using hash functions. The values are then stored in a data structure called hash table.

  • For example:

  • To enter a name in to the hash table we found out the hash value by applying a suitable hash function.

  • The hash function maps the name into an integer between zero and k-1 this value is used as an index in the hash table.

Image of the hash table

Image of the Hash Table

Given the image is define the hash table and operations

The hash table example

The Hash Table Example

Given the image is define the hash table example

Question number: 407

» Languages » Assembly Language

Short Answer Question▾

Write in Short

Name the different components of an assembly.

Explanation

An assembly is a logical unit made up of the following components:

  • Assembly manifest

  • MSIL source code

  • Type metadata

  • Resources

Question number: 408

» Basic CS » Data Structures

Essay Question▾

Describe in Detail

What are the types of Collision Resolution technique and methods used in each of the type?

Explanation

For open addressing (closed hashing), the methods for collusion resistance are overflow block:

  • Closed hashing stores all records directly in the hash table.

  • Bucket hashing is a type of closed hashing.

  • Each record I has a home position .

  • If another record occupies i’s home position, then another slot must be found to store i.

  • The new slot is found by a collision resolution policy.

  • Search must follow the same policy to find records not in their home slots.

Image of the closed hashing

Image of the Closed Hashing

Image of the closed hashing

    • Closed addressing (open hashing) can use linked list, binary tree for collusion resolution

  • “Separate list” explains why open hashing is also known as “separate chaining”

  • For instance, the “open” in “open addressing” tells us the index at which an object will be stored in the hash table is not completely determined by its hash code.

  • Instead, the index may vary depending on what’s already in the hash table.

  • Overflown elements hang off from the main table using list or tree.

Image of open hashing

Image of Open Hashing

Given the image is define the Example of open hashing (separate chaining)