Questions tagged [data-structures]

Questions about ways of storing data so that it can be used advantageously by algorithms.

361 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
-1
votes
1answer
53 views

About Depth first search

Graph Is 1) A D F E G C B and; 2) A D F E G B C is one of deep-first transverse? The code below is written in java and method1 and method2 is two different implementation. ...
-1
votes
1answer
390 views

What is the amortized time complexity of inserting an element to this heap?

Assume you implement a heap using an array and each time the array is full, you copy it to an array double its size. What is the amortized time complexity (for the worst case) of inserting elements ...
-1
votes
1answer
506 views

Priority Queue using an AVL tree, run time question

This is a question I want to answer in pseudocode: This is regarding a sort of priority queue using an AVL tree. I initialize a global variable (named GLOB) with 0. I receive from the user an input ...
-1
votes
1answer
130 views

Maximum frequency in any row and column

I have been given 2D matrix with some elements. I want to find out what is maximum frequency in any row and column. Example: 1 2 1 2 3 4 1 2 1 1 1 1 2 2 2 2 Maximum frequency is 6 which occurs in last ...
-1
votes
1answer
496 views

Fit stack of stone of varying length into a well of varying length

I have a stack of m stones of different Diameter. stack = [5,4,9,20,1] And a Well that is of depth n with varying diameter at different depths . ...
-2
votes
1answer
354 views

Obtain data structure able to do reverse range updates

For given array $A$ of size $N$, note that the array is going to be permutation of the numbers from 1 to N, each number will be there exactly once, we want to obtain data structure being able to ...
-2
votes
1answer
470 views

Boruvka/Sollin's algorithm for MST

Please help me regarding following problem- Let us consider Boruvka/Sollin's algorithm . Note that Boruvka/Sollin algorithm selects several edges for inclusion in T at each stage. It terminates when ...
-2
votes
1answer
436 views

Min-Heap Insertion Problem

I try to insert 4-9-3-7 and 1 (left to right) into a Min-Heap (using array implementation). Then 5 times Remove Smallest Number from this Min-Heap. how many swap between two elements in array occurred?...
-3
votes
1answer
37 views

Need help on stack related question

Ran into a problem, anyone can help?
-3
votes
0answers
29 views

Is the correct way to carry out a quick sort algorithm?

I have a question regarding the quicksort algorithm where the first element is the pivot. I'm still new at this and have been a little confused whether I'm going at this in the right direction. Is ...
-3
votes
1answer
4k views

Constructing binary search tree from given data

The data are in alphabets. U, N, I, V, E, R, S, I, T, Y, O, F, P, O, K, H, A, R, A. Perform pre, in and post order traversals. I'm confused as how to construct it in the 1st place. Only sense i ...

1
4 5 6 7
8