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

  • SEARCH
  • Home
  • 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 7524723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:08:30+00:00 2026-05-30T03:08:30+00:00

I am manipulating many instances of the same data structure which can have one

  • 0

I am manipulating many instances of the same data structure which can have one of four states. Currently I implement the states using True/False pairs:

(True, True)
(True, False)
(False, True)
(False, False)

With those data-structures I repeatedly apply two functions f, g where

g((True, True)) = (True, False)
g((True, False)) = (True, True)
g((False, True)) = (False, False)
g((False, False)) = (False, True)

and

f((True, True)) = (False, False)
f((True, False)) = (False, True)
f((False, True)) = (True, False)
f((False, False)) = (True, True)

Can I improve upon this data structure for those two functions? (I want to optimise for speed.)

  • 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-05-30T03:08:32+00:00Added an answer on May 30, 2026 at 3:08 am

    Use an integer in the range of 0..3 and implement the state transitions with bit arithmetic (g xors with 1; f xors with 3).

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

Sidebar

Related Questions

which one should be used to manipulating data, Array or Array Object? Like search,sort
I'm manipulating few data with PHP, I have the choice between Json and XML.
I have started using data.table. Indeed it is very fast and quite nice syntax.
Say I have a one to many relationship in my database between orderstatus and
When manipulating Handler Mappings using the Microsoft.Web.Administration namespace, is there a way to remove
I know that accessing and manipulating the DOM can be very costly, so I
We have a thick client app using jQuery heavily and want to profile the
I have a couple of simple objects that have a many-to-many relationship. Django has
I have been tasked with rendering and manipulating 3d objects in the browser and
I have a 1 row, many column flex datagrid. I would like to turn

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.