Splaying algorithm, Data Structure & Algorithms

Assignment Help:

Insertion & deletion of target key requires splaying of the tree. In case of insertion, the tree is splayed to find the target. If, target key is found out, then we have a duplicate and the original value is maintained. However, if it is not found, then the target is inserted as the root.

In case of deletion, the target is searched through splaying the tree. Then, it is deleted from the root position and the remaining trees reassembled, if found out.

Hence, splaying is used both for insertion and deletion. In the former case, to determine the proper position for the target element and avoiding duplicity and in the latter case to bring the desired node to root position.


Related Discussions:- Splaying algorithm

Number of operations possible on ordered lists and arrays, Q. Enumerate num...

Q. Enumerate number of operations possible on ordered lists and arrays.  Write procedures to insert and delete an element in to array.

Define doubly linked list, A list item stores pointers and an element ...

A list item stores pointers and an element to predecessor and successor. We call a pointer to a list item a handle . This looks simple enough, but pointers are so powerful tha

Array-based representation of a binary tree, Assume a complete binary tree ...

Assume a complete binary tree T with n nodes where each node has an item (value). Label the nodes of the complete binary tree T from top to bottom & from left to right 0, 1, ..., n

Graph, adjacency multilist

adjacency multilist

Trees, What is AVL Tree? Describe the method of Deletion of a node from and...

What is AVL Tree? Describe the method of Deletion of a node from and AVL Tree ?

Advanced trees, Linked list representations contain great advantages of fle...

Linked list representations contain great advantages of flexibility on the contiguous representation of data structures. However, they contain few disadvantages also. Data structur

How can a lock object be called in the transaction, How can a lock object b...

How can a lock object be called in the transaction? By calling Enqueue and Dequeue in the transaction.

Multiplication, Implement multiple stacks in a single dimensional array. Wr...

Implement multiple stacks in a single dimensional array. Write algorithms for various stack operations for them.

Simplifying assumptions of wire frame representation, Simplifying Assumptio...

Simplifying Assumptions of wire frame representation Neglect colour - consider Intensity: For now we shall forget about colour and restrict our discussion just to the intensi

Searching, Searching is the procedure of looking for something: Finding one...

Searching is the procedure of looking for something: Finding one piece of data that has been stored inside a whole group of data. It is frequently the most time-consuming part of m

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd