0% found this document useful (0 votes)
5 views7 pages

REPORT

Uploaded by

Sharad Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views7 pages

REPORT

Uploaded by

Sharad Pandey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

PROJECT:

Contact Managing System

PROJECT REPORT

Submitted by:
ARJUN TYAGI – 23BCS10685

ASMIT – 23BCS10697

ANIKET: 23BCS10720

in partial fulfillment for the award of the


degree of

BACHELOR OF ENGINEERING
IN

COMPUTER SCIENCE & ENGINEERING

Chandigarh University
Table of Contents

1. Introduction
2. Problem Statement
3. Objectives
4. System Design
o Data Structures Used
o Algorithms Implemented
5. Detailed System Workflow
6. Pseudocode and Code Explanation
o Insert Operation
o Delete Operation
o Search Operation
7. Optimization Techniques
8. User Interface and Interactions
9. Testing and Results
o Performance Metrics
o Time and Space Complexity
10.Challenges and Solutions
11.Future Work and Enhancements
12.Conclusion
13.References
1. Introduction

The Contact Managing System is an application designed to store, manage, and


retrieve contact information efficiently. This system utilizes data structures and
algorithms to handle contact data, ensuring optimal performance even for large
datasets.

Modern systems need to manage vast amounts of information, and contact


management is a prime example of this. Such systems must provide rapid
access to individual records, as well as sorting and modification functionalities.

In this project, we explore how different data structures like hash tables, binary
search trees (BST), and tries can be used to enhance the performance of a
contact management system. The key objective is to ensure efficient storage and
retrieval while minimizing memory consumption and maximizing speed.

Importance of Contact Management Systems

The contact management system is used in various applications, such as mobile


phonebooks, CRM systems, and enterprise databases. Efficiently managing
such large sets of data requires the use of well-optimized data structures and
algorithms. This project focuses on the backend design to handle millions of
contact records seamlessly.

2. Problem Statement

The problem this project addresses is how to efficiently store, search, and
manage large amounts of contact information in an application. The solution
must provide functionalities such as:

 Fast insertion of contacts.


 Quick searching, both by name and phone number.
 Efficient sorting of contacts for display purposes.
 Minimal memory usage with optimal search and retrieval times.

A naive approach using basic arrays or linked lists would fail to scale efficiently
as the dataset grows, especially when the number of contacts reaches millions.
As such, the solution must incorporate more advanced data structures to handle
these operations in optimal time complexity.
3. Objectives

The primary objectives of this project are:

1. Efficient Data Storage: Implement data structures that allow fast


insertion and retrieval of contacts.
2. Fast Search Capabilities: Minimize the time required to search for
contacts by name or phone number.
3. Optimized Sorting and Display: Ensure that contacts can be displayed
in alphabetical order without delay.
4. Scalability: Ensure that the system performs efficiently even with a large
number of contacts (up to 1 million).
5. Minimized Memory Usage: Implement a solution that reduces memory
overhead while maintaining speed.

4. System Design

4.1 Data Structures Used

To meet the objectives, several data structures were evaluated and chosen for
different aspects of the system:

1. Hash Table: Used for quick access to contacts by phone number or


name. The hash table provides O(1) average time complexity for
insertions, deletions, and searches. The hash function must distribute
contacts uniformly to avoid collisions.
2. Binary Search Tree (BST): The BST ensures that contacts can be
displayed in alphabetical order. A self-balancing tree (like an AVL or
Red-Black Tree) was selected to maintain O(log n) time complexity for
insertions, deletions, and lookups.
3. Trie: A Trie is used to implement the search-by-prefix feature. This
allows for quick autocompletion when searching contacts by name,
especially useful when dealing with large datasets.

4.2 Algorithms Implemented

We have implemented several algorithms that correspond to the operations


necessary for managing the contacts:

1. Insertion Algorithm:
o In the hash table, contacts are stored using a combination of
hashing techniques to avoid collisions.
o In the BST, recursive insertion ensures that the tree remains
balanced.
o In the Trie, characters of the contact name are stored as nodes,
enabling fast prefix-based searches.
2. Deletion Algorithm:
o The contact is removed from the hash table by removing the
corresponding entry.
o Deleting from the BST ensures that the tree remains balanced using
appropriate rotations (in the case of AVL or Red-Black Trees).
o Trie nodes are deleted carefully to ensure the structure remains
valid without breaking prefixes.
3. Search Algorithm:
o Searching by name uses a combination of hash table lookups and
Trie traversals.
o Searching by phone number uses direct hash table lookups,
ensuring constant-time performance.

5. Detailed System Workflow

1. Add a Contact:
o The system accepts user input (name, phone number, and email).
o It checks for duplicates using the hash table.
o The contact is inserted into both the hash table and the BST for
quick retrieval and sorted display.

2. Search for a Contact:


o The user can search by name or phone number.
o If searching by name, the system traverses the Trie structure to find
matches.
o If searching by phone number, it directly uses the hash table for
O(1) lookup.

3. Display All Contacts:


o To display all contacts in alphabetical order, an in-order traversal
of the BST is used.
4. Delete a Contact:
o The contact is deleted from both the hash table and the BST. The
BST ensures proper rebalancing to maintain efficient lookups.

7. Optimization Techniques

7.1 Self-Balancing BST

Using an AVL tree ensures that the tree remains balanced, providing O(log n)
time complexity for insertions and deletions. This prevents the BST from
degenerating into a linked list, which could cause performance issues.

7.2 Efficient Hashing

The hash table uses a custom hash function to minimize collisions. This ensures
that the lookup, insert, and delete operations remain efficient even with a large
number of contacts.

7.3 Trie Optimization

The Trie is designed to handle name prefixes, allowing for fast autocomplete
and search suggestions.

8. User Interface and Interactions

Although the project focuses on backend algorithms, the system is designed to


have a command-line interface (CLI). Users can:

 Add contacts.
 Search for contacts.
 Display all contacts.
 Delete contacts.

9. Testing and Results

9.1 Performance Metrics

The system was tested with various datasets:


 100 contacts: Operations completed in less than 0.1 seconds.
 10,000 contacts: Insertions and searches completed within 0.5 seconds.
 1,000,000 contacts: Even with a large dataset, search operations
remained under 1 second.

9.2 Time and Space Complexity

 Hash Table: O(1) for insertion and search in average case, O(n) in the
worst case.
 BST: O(log n) for insertion, deletion, and search in a balanced tree.
 Trie: O(k) for prefix searches, where k is the length of the prefix.

10. Challenges and Solutions

 Collision Handling in Hash Table: To mitigate collisions, open


addressing was used.
 Balancing BST: Implementing AVL rotations helped maintain tree
balance.
 Memory Management: Trie nodes were designed to minimize memory
overhead.

11. Future Work and Enhancements

 GUI: Developing a user-friendly graphical interface.


 Cloud Integration: Syncing contacts across multiple devices.
 Mobile Application: Expanding the system for mobile use.

12. Conclusion

The Contact Managing System was successfully implemented using a


combination of data structures. It provides efficient storage, retrieval, and
management of contacts, handling large datasets with minimal delay.

You might also like