You are on page 1of 6

JAYPEE INSTITUTE OF INFORMATION

TECHNOLOGY
NON LINEAR DATA STRUCTURES

AUTOCOMPLETE

USING SKIPLIST

SUBMITTED BY GROUP-3 SUBMITTED TO

SWATI PANDEY (20104017, B14) DR. SARISHTY GUPTA

YASH BHANDARI (20104022, B14) DR. NEHA SHARMA

SHAURYA SHARMA (20104024, B14)

VANSHIKA JAIN (20104026, B14)

1
Contents

S.NO. TOPICS PAGE NO.


1. INTRODUCTION 3

2. FEATURES OF THE PROJECT 3

3. IMPLEMENTATION DETAILS 4

4. RESULT AND ANALYSIS 5

5. OUTPUT SNAPSHOTS 5

6. CONCLUSION 6

7. DIVISION OF WORK 6

8. REFERENCES 6

2
Introduction: -
Autocomplete is a feature in modern applications that predicts the remaining characters
or words that a user is likely to input based on their previous search history, queries, and
context. One way to implement this feature is by using a skip list, which is a probabilistic
data structure used for efficient searching and sorting of elements in a list. Skip lists are
implemented as a series of linked lists with different skip factors, and each level skips 2
or 3 elements at a time. To implement autocomplete using a skip list, a dictionary of
words is created, and a skip list of words is made with multiple levels, each containing a
subset of the words from the previous level. The top level of the skip list contains a
single word, which is the first letter of each word in the dictionary.

Features of the Project: -


The autocomplete using skip list project has the following features:

● Efficient autocomplete: The main feature of this project is to provide an efficient


autocomplete functionality using the skip list data structure. The project allows
users to generate a list of autocomplete suggestions based on a given prefix.
● Insertion and removal of elements: The skip list data structure allows for efficient
insertion and removal of elements. This feature enables users to add or remove
elements from the skip list quickly.
● Search functionality: The skip list also provides an efficient search functionality
that allows users to search for a specific element in the skip list.
● Customizable probability: The probability of increasing the level of the skip list
can be customized according to the user's requirements. This feature provides
users with the flexibility to adjust the skip list's level based on their data size and
usage patterns.
● Easy to use: The project is easy to use, and users can quickly get started with the
autocomplete functionality.
● Scalability: The skip list data structure is scalable and can handle large datasets
with ease. As the number of elements in the skip list grows, the efficiency of the
autocomplete functionality remains high.
● Customizable prefix length: The project allows users to customize the prefix
length, enabling them to generate autocomplete suggestions based on longer or
shorter prefixes as needed.

3
Overall, the autocomplete using skip list project provides an efficient and scalable
solution for implementing autocomplete functionality in various applications. The
features provided by the project make it easy for users to customize the functionality
based on their requirements, enabling them to generate accurate autocomplete
suggestions quickly and efficiently.

Implementation details: -
The implementation of the autocomplete using skip list project involves the following
steps:

● Defining the Node class: The first step is to define the Node class that represents
a node in the skip list. The Node class should contain a value and an array of
forward pointers that point to the next nodes in each level of the skip list.
● Defining the SkipList class: The next step is to define the SkipList class that
represents the skip list data structure. The SkipList class should contain a
reference to the head node, the maximum level of the skip list, the probability p of
increasing the level of the skip list, and the current level of the skip list. The class
should also contain methods for inserting, removing, searching, and generating
autocomplete suggestions.
● Implementing the insert method: The insert method should traverse the skip list
from the highest level to the lowest level, updating the forward pointers of the
nodes along the way to insert the new node in the correct position.
● Implementing the remove method: The remove method should remove the
specified value from the skip list by traversing the skip list and updating the
forward pointers of the nodes as needed.
● Implementing the search method: The search method should search for a
specific value in the skip list by traversing the skip list and comparing the values
of the nodes.
● Implementing the autocomplete method: The autocomplete method should
generate a list of autocomplete suggestions based on a given prefix by traversing
the skip list from the highest level to the lowest level and adding all nodes with
values that start with the prefix to a list.
● Testing the implementation: The final step is to test the implementation by
creating a SkipList object and adding some elements to it. The implementation
should generate accurate autocomplete suggestions based on a given prefix.

4
Result and Analysis: -
The autocomplete using skip list project provides an efficient and scalable solution for
implementing autocomplete functionality. The skip list data structure allows for efficient
insertion, removal, and searching of elements, enabling the project to provide accurate
autocomplete suggestions quickly and efficiently.

The project also provides customizable options, such as the ability to adjust the
probability of increasing the level of the skip list and the ability to customize the prefix
length used for generating autocomplete suggestions. These options provide users with
the flexibility to tailor the functionality to their specific needs.

In terms of performance, the skip list data structure used in the project provides
logarithmic time complexity for insertion, removal, and searching operations. This time
complexity makes the autocomplete functionality efficient even for large datasets.

Overall, the autocomplete using skip list project is an effective and efficient solution for
implementing autocomplete functionality in various applications. The customizable
options and efficient performance make it a versatile and scalable solution for various
use cases.

Output Snapshots: -

5
Conclusion: -
In conclusion, the autocomplete using skip list project provides an efficient and scalable
solution for implementing autocomplete functionality. The skip list data structure used
in the project provides logarithmic time complexity for insertion, removal, and searching
operations, making the autocomplete functionality efficient even for large datasets.

The project also provides customizable options, such as the ability to adjust the
probability of increasing the level of the skip list and the ability to customize the prefix
length used for generating autocomplete suggestions. These options provide users with
the flexibility to tailor the functionality to their specific needs.

Overall, the autocomplete using skip list project is an effective and efficient solution for
implementing autocomplete functionality in various applications. Its efficient
performance and customizable options make it a versatile and scalable solution for
various use cases.

Division of work among Team Members: -


As it was the group project, work was not specifically distributed but all the members
worked fairly, equally and effectively with each other. Communicating regularly made it
easy to keep track of the project.

References: -
● Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein.
Introduction to Algorithms, Third Edition. The MIT Press, 2009.
● https://www.geeksforgeeks.org/skip-list-set-2-insertion/.
● https://www.cs.cmu.edu/~ckingsf/bioinfo-lectures/skiplists.pdf.
● https://www.baeldung.com/cs/skip-lists.

These references provided valuable insights and guidance for the development of the
autocomplete using skip list project.

You might also like