Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8898205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:33:15+00:00 2026-06-15T00:33:15+00:00

I have been studying Splay trees because I would like to implement one. Currently,

  • 0

I have been studying Splay trees because I would like to implement one. Currently, I have some “autodidactic” experience with Red-Black trees, AVL trees, Skip lists and other simpler data structures. I want to implement my first splay tree, but I want a recursive implementation for it, if possible (I love recursion).

However, I think it’s difficult because you have to see two levels down the tree to observe all the possible cases (zig-zag, zig-zig, zar), and there is no way to mark the target without another field. Should I use another field, like in red-black trees, to mark the visited nodes and splay the target node?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:33:16+00:00Added an answer on June 15, 2026 at 12:33 am

    It’s easy enough to use a recursive algorithm, and it might work out looking fairly clean. No marking is necessary. Remember that the splay operation (which is used for find, insert and delete) brings the target node to the top of the tree; in other words, it returns the (splayed) tree with the target node at the top.

    In essence, you need to decide from a given node what the next two moves will be (left-left, right-right, or anything else.) The rotation happens when you go the same direction twice.

    There’s a nice implementation for functional languages in Chris Okasaki’s Purely Functional Data Structures, which imho is one of the finest short CS texts in existence.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been studying because I have an exam and I don't have many problems
i have been studying unity3d for a few months and i have done some
I am confused about the terminology of the below trees, I have been studying
I have been studying a jQuery plugin. The plugin extends $.fn as you would
i have been recently studying php and mysql and also is currently developing a
I have been studying python for quite sometime now and very recently I decided
I have been studying DDD in-depth on my own time; reading everything about it
I have been studying unicode and its Python implementation now for two days, and
I am new to Python and have been studying its fundementals for 3 months
Over the last few weeks I have been studying the MVC design pattern for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.