|
by: Daniele Varrazzo |
last post by:
If you need a container to look into, there is the sets module that provides
a couple of them.
If you need a sorted list, there is the bisect module. But i don't think it
fits your need for a quick lookup: it's a python module so probably it's
slower. Furthermore you can __hash__ almost everything, but you can __cmp__
in a consistent way much less stuff.
Take definitely a look at sets.
|
by: Egor Bolonev |
last post by:
why functions created with lambda forms cannot contain statements?
how to get unnamed function with statements?
|
by: MackS |
last post by:
Dear all,
I've got several large sets in my program. After performing several
operations on these I wish to present one set to the user
sorted according to a certain criterion. Is there any direct way to do
so? Or must I
list =
for item in set1:
|
by: Der Andere |
last post by:
I need to implement a sorted (ordered) list. STL has no sorted list type as
far as I know. Is there a (straight) way to implement a sorted list using
STL?
BTW: The type of items in the list will be a class. Is it necessary to
implement the > or < operators or to write a compare-function that returns
the larger or smaller of two classes? Ideally, the list begins with the
smallest element.
Cheers,
Matthias
|
by: Andrew Clark |
last post by:
*** post for FREE via your newsreader at post.newsfeed.com ***
it's been a while since i have poseted to this newsgroup, but for a long
time i was not programming at all. but now that i am out of college and
facing the prospect of getting a real job, i need to get back into the
game. anyway, i don't know if some of you know the stanford CS library. i
took the problem set a while back and have recently rediscovered it adn
have been trying...
|
|
by: J L |
last post by:
I want to create a sorted list whose values are themselves sorted
lists. I wrote the following simple test program but it does not
behave as I would expect.
What I wanted to do was have the doorConflictList be keyed on a door
ID and contain a sorted list called conFlictList. I wrote this
expecting the following
doorConflictList should end up with 3 items.
Item 1 would be a sorted list with 1 item
|
by: shrishjain |
last post by:
Hi All,
I need a type where I can store my items in sorted order. And I want to
keep adding items to it, and want it to remain sorted. Is there any
type in .net which I can make use of.
I see there is SortedList<key, value> for hash tables, but could find
anything for a sorted list.
Currently I am using List<string> and whenever I add an item, I need to
|
by: Khayrat |
last post by:
Hi folks, please help
I have a xml file with a list of items. The list is sorted during xslt
processing. Based on this sorted list I want a navigation facility to
walk through the sorted list starting from a choosen item via <back> and
<next>.
Say this is the list:
<a>
|
by: John |
last post by:
I am coding a radix sort in python and I think that Python's dictionary may
be a choice for bucket.
The only problem is that dictionary is a mapping without order. But I just
found that if the keys are numeric, the keys themselves are ordered in the
dictionary.
part of my code is like this:
radix={}
for i in range(256):
|
by: Guy |
last post by:
Is there a better way to search identical elements in a sorted array
list than the following:
iIndex = Array.BinarySearch( m_Array, 0, m_Array.Count,
aSearchedObject );
aFoundObject= m_Array;
m_ResultArray.Add ( aFoundObject);
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|