473,320 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Which STL datastructure for O(log n) search ?

Digital Don
Hi,

Iwas trying to look for a STL datastructure in C++ where I can store structure variables and then get out value from it by just comparing the value as follows;

The structure variable: "strctvar";
The STL datastructure: "STLstruct";

Storing multiple different of "strctvar"s into "STLstruct";

to get a particular value of "strctvar" in "STLstruct", I want it to be as simple as

newstrctvar = STLstruct.value("xyz") ;

where "xyz" is a value of"name" in the structure

struct
{
string name;
int x;
}strctvar;

Is any thing like this possible...

I think I am asking too much...but I think there i something like this in STL but cant find which one is it. So please help me find the one..

Thank You in Advance
Mar 2 '08 #1
2 1537
Ganon11
3,652 Expert 2GB
The STL set class is implemented with a sort of Binary Search Tree (I think an optimized Red-Black tree), and most (if not all) of its operations are guaranteed O(log n) time. Searches are definitely O(log n).
Mar 2 '08 #2
Thank You for the reply. I think this will help me.

I am new using the STL structures and am enjoying learning all these stuff...These make out work so easy..
Mar 5 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Rg | last post by:
Hello, I am very beginner with jscript. I have an Apache PHP enabled webserver and want to know from where users are coming from. Understand I want the last surfer's browser visited url. I...
6
by: lainedacier | last post by:
Hi, I'm looking for a library that can search through an XML document tree, locate an element by attribute (ideally this can be done through XPath), and insert an element (as its child). ...
7
by: Curious | last post by:
Hi, I have created my own data structure. Basically it is a two way 'stack', where I can push elements and pop elements both from top and bottom. I also included a counter to show the number...
3
by: Jmc | last post by:
Hi I'm trying to build a log viewer, its going to be part of a contentmanagement system and needs some extra features that commersial logviewers don´t have. The log files (IIS log) are...
10
by: David Thielen | last post by:
Hi; I am trying to write to the event log using: public const string EVENT_LOG_NAME = "Windward Portal"; if (!EventLog.SourceExists(EVENT_LOG_NAME)) EventLog.CreateEventSource(EVENT_LOG_NAME,...
6
by: Karim Ali | last post by:
Hi, I am writing a program that will take several days to execute :) and would like to append to a log file but be able to open that file at any time and see the errors that have occured. So...
21
by: Pieter | last post by:
Hi, I need some type of array/list/... In which I can store objects together with a unique key. The most important thing is performance: I will need to do the whole time searches in the list of...
1
by: mravik | last post by:
Hi All, I have different subsystems in my application, if one is down it will through some error message in log file. I have a collection of error messages in another file and I want to check each...
2
by: notnorwegian | last post by:
Traceback (most recent call last): File "C:/Python25/Progs/WebCrawler/spider2.py", line 47, in <module> x = scrapeSites("http://www.yahoo.com") File "C:/Python25/Progs/WebCrawler/spider2.py", line...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.