We have a big List of >1000 items with big classes (of the same type). The list is inserted or deleted very frequent. About 10 or 20, 30 items inserted at a time. With each item, I find exact position to insert using quick search algorithm. But I wonder if I add every items to the end of the list then do the sort using List.Sort (I believe that MS use quick sort algorithm) then it will be better: consume less CPU like current? I am using C#, .Net Framework 2.0.
Find exact position then insert or add then sort? Which is better?
132 views Asked by QuangND At
1
There are 1 answers
Related Questions in C#
- How to call a C language function from x86 assembly code?
- What does: "char *argv[]" mean?
- User input sanitization program, which takes a specific amount of arguments and passes the execution to a bash script
- How to crop a BMP image in half using C
- How can I get the difference in minutes between two dates and hours?
- Why will this code compile although it defines two variables with the same name?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Why can't I use the file pointer after the first read attempt fails?
- #include Header files in C with definition too
- OpenCV2 on CLion
- What is causing the store latency in this program?
- How to refer to the filepath of test data in test sourcecode?
- 9 Digit Addresses in Hexadecimal System in MacOS
- My server TCP doesn't receive messages from the client in C
- Printing the characters obtained from the array s using printf?
Related Questions in .NET-2.0
- Existing Encryption and Validation method in Machine Key of IIS suddenly stops working
- Why are my input values not binding to my viewmodel?
- Why add-migration command is giving error although build succeeds in Visual Studio using .NET
- Legacy .NET CF download - Post-deploy error 0x00000001
- XmlSerializer much slower when a different constructor for it is used
- Part of DOM is deleted in ASP.NET 2.0 app on IIS 10
- What's the Microsoft DI equivalent of Castle.Windsor's DependsOn Dependency.OnValue
- C# NET. Framework 2.0 | Make a delay?
- TimeSpan.Parse of string including days dd-hh:mm:ss
- Webclient doesnt like UrlEncoded slash. How to make it work?
- unity c#, unable to acces a variable form another script
- How do I refresh my datagrid view from another form after I insert and update my values inside my database?
- Why can't I update my dates in database from 01/01/1753?
- Why is my datagrid not updating after I update my database?
- How do I compile a simple WinForms C# application for .NET Framework 2.0 in Visual Studio 2005 or 2019?
Related Questions in QUICKSORT
- Does Sort() method in C# use recursion?
- The algorithm works but between 20 M records, it stops at 6.5 M and then gives me segmentation fault. Is this merge-sort algorithm correct?
- Runtime error when running QuickSort using while loops in split function
- Quicksort algorithm printing a segmentation fault, not working properly
- I have a time complexity of ( log ()+()), how should I modify the code to have a complexity of ( log ()+())
- Quick Sort troubleshooting (C++)
- Stack overflow with high length arrays for my quick sort function
- Quick sort recursive/iterative speed variation and how to graph them on C++?
- Find four,whose sum equals to target
- Quicksort with last element as pivot not sorting
- Quicksort partition algorithm -- why is the swap with the pivot value outside of the loop?
- Get Quicksort list as a whole to visualize while using recursion
- Measured time inconsistent on swapping measuring order
- Problem with quicksort function on arrays of 64 bits integers in C
- I'm trying to animate a quick sort using matplotlib, but the code only loops correctly without the plot. The code logic is exactly the same
Related Questions in QUICK-SEARCH
- Shopware 6 plugin: How to configure quick search options
- Quick search in a JSON
- multiple selection and quick search
- Quick Search do not retrieve "can not find" recently added records
- Can jQuery Quicksearch be configured to only return exact matches?
- How to make jQuery Quicksearch accept search terms in any order?
- In PyCharm, when searching a list by typing, how to jump between search results?
- Boyer - Moore string search into Sunday string search (quick string search) c++
- PouchDB quick search: Search within for loop and return results AFTER for loop finish
- jquery quicksearch searching also header
- QuickSearchJS with ajax call
- Elasticsearch. How to realize the following principles combining it with quick search?
- Does Android still support Quick Search Box integration?
- setTimeout and e.preventDefault
- Quick search box for Contacts in Android
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
There's rarely a general answer to questions like these. It depends very heavily on your scenario. But here's an intermediate suggestion between the two choices you bring up:
Sort the list of items to be inserted (this requires sorting 10 - 30 items based on your description). Then, insert these in order. Note that once you find the position to insert the first item, the position to insert the second item must be strictly after that location (and so on, for each subsequent item), so you don't need to search starting from the beginning again. The list being inserted into only needs to be searched through in this case as it would maintain its ordering after each insertion.