answersLogoWhite

0

Most likely your comparison-function returns the opposite of the expected value.

int Comparator (const void *left, const void *right);

return -1 if left<right

return 0 if left==right

return 1 if left>right

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the difference between binary tree and tree data structure?

binary tree is a specific tree data structure where each node can have at most 2 children nodes. In a general Tree data structure nodes can have infinite children nodes.


Difference types of nonlinear data structure?

Tree, Graphs are the types of nonlinear data structure.


What do you call a tree without node in data structure?

A null tree.


What is the time complexity of operations in a B-tree data structure?

The time complexity of operations in a B-tree data structure is O(log n), where n is the number of elements in the tree.


What is the best data structure for notepad?

i think it will be tree...


What is the height of a specific node in a tree data structure?

The height of a specific node in a tree data structure is the number of edges on the longest path from that node to a leaf node.


Define tree in data structure?

Tree is directed, cycle-less, connected graph.


How the index of the DBMS is organized and works?

A database index is a data structure that improves the speed of data retrieval operations in DBMS. An index can be created using one or more columns of a database table, providing the basis for both rapid random lookups and efficient access of ordered records. Most indexes use a B-tree structure. A B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic amortized time. The B-tree is a generalization of a binary search tree. The B-tree is optimized for systems that read and write large blocks of data. There are several index types out there: Bitmap index Dense index Sparse index Reverse index Etc...


What is non linear data strcuture?

A tree is an example for a non-linear data structure.


Which data structure represent many to many relationship?

tree


Is a heap a type of tree structure?

No, a heap is not a type of tree structure. A heap is a specialized tree-based data structure commonly used in computer science for efficient priority queue operations.


What is the difference between primitive and non primitive data structure?

A primitive data structure is generally a basic structure that is usually built into the language, such as an integer, an array or a linked-list.A non-primitive data structure is built out of primitive data structures linked together in meaningful ways, such as a binary search tree, AVL Tree, Hashtable, etc.