top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a list of data structures that a competitive programmer must know?

+3 votes
257 views
which are most important.
posted Apr 30, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

That depends on the problem you are trying to solve. If a problem is mapped to the most efficient data-structure which captures the essence of that problem, then it leads to an elegant solution of the problem.

The "right" choice of data-structure would not only depend on the representation of the inputs, but the query it is supposed to be optimal for. E.g if asked to find a number among the list of number efficiently, then BST(Binary Search Tree) is a choice which would efficiently represent the input data for the set of all point search queries. If the query was for a range of numbers, and not just a single number, then BST is no longer the optimal choice but the data-structure to choose is maybe B+ Tree.

answer Apr 30, 2016 by Rajan Paswan
0 votes

As Rajan said it depends on the problem you are trying to solve but a good programmer should know atleast following DS as use them as per need -
1. Array
2. Stack
3. LinkList
4. Tree
5. Binary Search Tree
6. Hash List

answer Apr 30, 2016 by Salil Agrawal
Similar Questions
+6 votes

I was trying to get maximum rectangle area for a given histogram but I used brute force approach which have O(n^2) time complexity so I want some better solution using stack so that we could reduce time complexity to O(n) or O(log n ).

+1 vote

How do you shuffle a binary tree without using any external data structures.
Note: With equal probability to every node.

...