REPORT
REPORT
PROJECT REPORT
Submitted by:
ARJUN TYAGI – 23BCS10685
ASMIT – 23BCS10697
ANIKET: 23BCS10720
BACHELOR OF ENGINEERING
IN
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
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.
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:
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
4. System Design
To meet the objectives, several data structures were evaluated and chosen for
different aspects of the system:
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.
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.
7. Optimization Techniques
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.
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.
The Trie is designed to handle name prefixes, allowing for fast autocomplete
and search suggestions.
Add contacts.
Search for contacts.
Display all contacts.
Delete contacts.
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.
12. Conclusion