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 7979171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:42:16+00:00 2026-06-04T09:42:16+00:00

I am using a BitSet buffer where i have about 500 bits inside and

  • 0

I am using a BitSet buffer where i have about 500 bits inside and i want to add about 10 bits at the start of the buffer, i mean at index 0 so the rest of the buffer should be shifted but I dont see a way to “add” a bit only write methods, so if i already have a bit there it will be replaced, no added.
Is there any way to do this or i have to copy all to a temporary BitSet, add my 10 bits and then add my 500 bits ?

Thank you 🙂

PD: Sorry my bad English feel free of making corrections too 🙂

  • 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-04T09:42:19+00:00Added an answer on June 4, 2026 at 9:42 am

    There is no way to insert bits at the front without copying.

    Perhaps you could reverse the order of the bits in your BitSet? If you did, that would mean you’re now appending bits to the end of the set, which can be done cheaply.

    Alternatively, you could encapsulate a Deque of BitSets. Then inserting bits at the front could be accomplished by inserting a new BitSet at the front of the Deque.

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

Sidebar

Related Questions

I am using a java.util.BitSet to store a dense vector of bits. I want
i have tried to implement following code #include <iostream> #include <bitset> using namespace std;
I have a BitSet and want to write it to a file- I came
I have been using the Bitset class in Java and I would like to
I want to implement a binary counter in C++ using std::bitset . If I
I have this inside my private class declarations #include stdafx.h using namespace std; template
Using Nunit, I want to be able to write a test fixture that will
Using C# for ASP.NET and MOSS development, we often have to embed JavaScript into
Is there any performance loss/gain using bitset in place where hand written? How to
I convert a character to binary using std::bitset<CHAR_BIT> binary('c'); but this doesn't work 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.