Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged sorting
0
votes
0
answers
31
I have a algorithm and i want to prove with induction, need help!
Hello, i have a algorithm and i want to prove it with induction how can i do that ? Also i want to worst case run time analyze but i am not very good please help me please. Thank you so much!
Hello, i have a algorithm and i want to prove it with induction how can i do that ?Also i want to worst case run time analyze but i am not very good please help me please...
mdboi
288
views
mdboi
asked
Oct 29, 2022
Algorithms
algorithms
sorting
time-complexity
+
–
0
votes
0
answers
32
PhD Admissions Written Test (Basic)
Let A be a sorted array of distinct integers of length n. Design an algorithm to find an index i such that A[i] = i if such an index exists. If there are more than one such indices, you may output any one ... −1. The asymptotic time complexity of the fastest algorithm for this problem, assuming the array is already available, is Θ ______________________________
Let A be a sorted array of distinct integers of length n. Design an algorithm to find an index i such that A[i] = i if such an index exists. If there are more than one su...
rsansiya111
466
views
rsansiya111
asked
Sep 10, 2022
Others
sorting
array
time-complexity
asymptotic-notation
+
–
0
votes
1
answer
33
Data structures and algorithms
Assume Two-Dimensional Sorted Array (TDSA) is a two-dimensional matrix of size n × n such as the elements in the matrix are sorted row-wise and column-wise. For example, the following matrix is a TDSA. 1 2 3 4 5 6 7 8 9 Write an algorithm that should convert the given matrix of a dimension n × n into TDSA. Analyse the running time of the algorithm.
Assume Two-Dimensional Sorted Array (TDSA) is a two-dimensionalmatrix of size n × n such as the elements in the matrix are sortedrow-wise and column-wise. For example, t...
Karthi2003
425
views
Karthi2003
asked
Sep 9, 2022
DS
algorithms
sorting
time-complexity
+
–
0
votes
1
answer
34
Algorithms
Given ‘N’ objects, which are coloured as red, white and blue. Sort these objects so that objects of the same colour are adjacent, with the colours in the order red, white and blue. Design an algorithm with a time com- plexity of O(nlog n)
Given ‘N’ objects, which are coloured as red, white and blue. Sort theseobjects so that objects of the same colour are adjacent, with the coloursin the order red, whi...
Karthi2003
656
views
Karthi2003
asked
Sep 9, 2022
DS
algorithms
sorting
time-complexity
+
–
1
votes
1
answer
35
TIFR CSE 2022 | Part B | Question: 3
Consider the problem of sorting $n$ single digit integers (base $10$). This problem can be solved in time $O(n \log n)$ but not $O(n \log \log n)$ $O(n \log \log n)$ but not $O(n)$ $O(n)$ but not $O(n / \log \log n)$ $O(n / \log \log n)$ None of the above.
Consider the problem of sorting $n$ single digit integers (base $10$). This problem can be solved in time$O(n \log n)$ but not $O(n \log \log n)$$O(n \log \log n)$ but no...
admin
797
views
admin
asked
Sep 1, 2022
Algorithms
tifr2022
algorithms
sorting
time-complexity
+
–
2
votes
0
answers
36
TIFR CSE 2022 | Part B | Question: 11
Consider the following function $\textsf{count},$ that takes as input $a,$ an array of integers, and $\textsf{N}$, the size of the array. int count(int a[], int N) { int i, j, count_FN; count_FN = 0; for (i=1 ; i<N ; i++) { j=i-1 ; while ... $\textsf{N} \geq c$, for all arrays of size $\textsf{N, count_FN} \geq \textsf{N}^2 / c$ None of the above
Consider the following function $\textsf{count},$ that takes as input $a,$ an array of integers, and $\textsf{N}$, the size of the array.int count(int a[], int N) { int i...
admin
419
views
admin
asked
Sep 1, 2022
Algorithms
tifr2022
algorithms
sorting
+
–
1
votes
1
answer
37
data structure and algorithms -- linked list -- size of a node
as we allocate the space for node in linked list using malloc() so how many bytes malloc allocate for the 1 node i.e. actual value of malloc allocates in ram like i write this code. so what is size of a node of linked ... node *)malloc(sizeof(struct node)); printf("%d",sizeof(struct node)); } what the printf prints and why ?
as we allocate the space for node in linked list using malloc() so how many bytes malloc allocate for the 1 node i.e. actual value of malloc allocates in ram like i write...
ykrishnay
632
views
ykrishnay
asked
Aug 5, 2022
Programming in C
data-structures
linked-list
algorithms
sorting
+
–
5
votes
1
answer
38
GO Classes Test Series 2023 | Algorithms | Test 1 | Question: 2
If we have an array of size $\mathrm{N}$ with only $3$ different values for its elements, what is the probability that the first partition results in a completely sorted array? Assume there are an equal number of each element in the array. $1 / 2$ $1 / 3$ $1 / 4$ $2 / 3$
If we have an array of size $\mathrm{N}$ with only $3$ different values for its elements, what is the probability that the first partition results in a completely sorted ...
GO Classes
480
views
GO Classes
asked
Jun 13, 2022
Algorithms
goclasses2024-algo-1-weekly-quiz
goclasses
algorithms
sorting
array
1-mark
+
–
0
votes
1
answer
39
Algorithm self doubt
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to reduce the time complexity to O(n)?
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to...
tusharb
658
views
tusharb
asked
Feb 18, 2022
Algorithms
algorithms
self-doubt
sorting
time-complexity
+
–
0
votes
1
answer
40
Gateoverflow Test series
Can anyone explain each option, for every option if it is true then why? If false then why? (Please don’t comment like answer is A,B etc) Please help
Can anyone explain each option, for every option if it is true then why? If false then why? (Please don’t comment like answer is A,B etc) Please help
raja11sep
835
views
raja11sep
asked
Jan 15, 2022
Algorithms
algorithms
sorting
time-complexity
multiple-selects
test-series
+
–
1
votes
2
answers
41
LPU MATERIALS
Number of comparisons required to sort letters in ALGORITHM? (A) 36 (B) 8 (C) 45 (D) 9
Number of comparisons required to sort letters in ALGORITHM?(A) 36 (B) 8(C) 45 (D) 9
Prerna naga
516
views
Prerna naga
asked
Dec 29, 2021
Algorithms
sorting
+
–
0
votes
1
answer
42
Nptel Assignment Question
Consider the following algorithm on a graph with edge weights. Sort the edges as [e1,e2,...,em] in decreasing order of cost. Start with the original graph. Consider each edge ej. If this edge is part of a cycle delete it. Which of the following is not ... at the end is a minimum cost spanning tree. Exactly m-n+1 edges will be deleted. At most n-1 edges will be deleted.
Consider the following algorithm on a graph with edge weights.Sort the edges as [e1,e2,...,em] in decreasing order of cost.Start with the original graph. Consider each ed...
rsansiya111
630
views
rsansiya111
asked
Dec 8, 2021
Algorithms
nptel-quiz
graph-algorithm
sorting
+
–
0
votes
3
answers
43
NPTEL Assignment Question
Suppose there are k sorted lists (decreasing order) with n/k elements in each list. What is the time complexity to merge them into one single sorted list. Hint: Maintain a heap of k elements. Think which k elements to choose. A. O(nlogk) B. O(n) C. O(nk) D. O(nlogn)
Suppose there are k sorted lists (decreasing order) with n/k elements in each list.What is the time complexity to merge them into one single sorted list.Hint: Maintain a ...
rsansiya111
695
views
rsansiya111
asked
Dec 8, 2021
Algorithms
algorithms
nptel-quiz
sorting
time-complexity
+
–
Page:
« prev
1
2
3
4
5
6
7
...
19
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register