binary-search
Optimizing search in CFArray
I have sorted CFArray, and I need to find the index of a value. But I am also not sure if the value is in this array, so I need to know this too.[详细]
2023-03-23 21:05 分类:问答First occurrence in a binary search
I\'m tinkering with some code and I realized something I never knew.A normal binary search will return a random index in a data set for a key that occurs more than once.How can I modify this code belo[详细]
2023-03-20 03:40 分类:问答find an element in a sorted matrix [duplicate]
This question already has answers here: How do I search for a number in a 2d array sorted left to right and top to bottom?[详细]
2023-03-18 07:39 分类:问答How can one add a specific part of a binary tree but keep the tree intact (Java)?
I am trying to write a code that searches a binary tree for an element and then adds starting at that element. So far I can find the correct position and add to that position, but I lose the rest of t[详细]
2023-03-18 04:58 分类:问答Does binary search have logarithmic performance of deque C++ data structure?
The standard says that std::binary_search(...) and the two related functions std::lower_bound(...)开发者_高级运维 and std::upper_bound(...) are O(log n) if the data structure has random access. So, gi[详细]
2023-03-14 18:42 分类:问答Binary Search Problems? [duplicate]
This question already has answers here: Closed 11 years ago. Possible Duplicate: What are the pitfalls in implementing binary search?[详细]
2023-03-13 15:42 分类:问答Binary search for specific value in array of structs
I wrote this function that uses a binary search to look for a specific value in an array of structs. Why doesn\'t it compile?[详细]
2023-03-10 21:37 分类:问答Searching over multiple entries in logn time
I have to write a program which create\'s an address book that can provide search functionality on multiple fields, with a large number of records. Binary search is an option but the tricky part is th[详细]
2023-03-10 01:45 分类:问答Why to consider binary search running time complexity as log2N
Can someone explain me when it comes to binary search we say the running tim开发者_开发技巧e complexity is O(log n)? I searched it in Google and got the below,[详细]
2023-03-09 21:13 分类:问答Find word in dictionary of unknown size using only a method to get a word by index
A few days ago I had interview in some big company, name is not required :), and interviewer asked me to find solution to the next task:[详细]
2023-03-08 17:15 分类:问答