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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:31:35+00:00 2026-05-16T18:31:35+00:00

I have a std::set which is of type point struct point { int x;

  • 0

I have a std::set which is of type point

struct point
{
  int x;
  int y;
  int z;
};

Suppose I want to perform three different operation on each variable in set i.e

  • Find the smallest number from x variables.
  • Get missing elements from y variables
    using set difference.
  • Get product of all z variables.

At this point, should i use three predefined alogrithmic functions in sequence or should I write my own alogrithm which would perform all three operations by iterating over the set the once?

  • 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-16T18:31:36+00:00Added an answer on May 16, 2026 at 6:31 pm

    Even if you get a ten-fold speed increase, if that piece of code only uses 5% of your application’s time, you’ve just decreased the execution time to 95%. So, unless you know this is a real bottleneck in your application, don’t waste time trying to optimize it. And the only way to know this is through profiling.

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

Sidebar

Related Questions

I have a struct called CoolStruct: struct CoolStruct { int id; uint32 type; uint32
I have a set of shared pointers: std::set<boost::shared_ptr<T>> set; And a pointer: T* p;
Do erase call in std::set invalidate iterator ? As i have done below 5th
I asked this question earlier. I am intrigued by std::set but I have another
Possible Duplicate: remove_if equivalent for std::map I have a set of strings: set <wstring>
I have to rewrite windows-code into crossplatform view. Here is the example: std::unordered_set<Type>::iterator it
I have a class which inherits from std::runtime_error like so: #include <string> #include <stdexcept>
I have a set of functions that are templated both by an integer type
I have set of classes. Each class is inherited from another class. The relationship
I have a class which accumulates information about a set of objects, and can

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.