Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged Algorithm

0 votes
685 views
1 answer
    I'm trying to recall an algorithm on Fibonacci recursion. The following: public int fibonacci(int n) { if( ... instead of calculating it again. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
682 views
1 answer
    I have a set of rectangles and arbitrary shape in 2D space. The shape is not necessary a polygon (it may be ... used. Could this method work? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
545 views
1 answer
    How to compute the integer absolute value without using if condition. I guess we need to use some bitwise operation. Can anybody help? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
660 views
1 answer
    This is an interview question. "How would you determine if someone has won a game of tic-tac-toe on a ... Can anybody explain the algorithm ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
599 views
1 answer
    How to find all chordless cycles in an undirected graph? For example, given the graph 0 --- 1 | | | | ... cycles. Cycle basis can have chords.) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
611 views
1 answer
    I was revising single source shortest path algorithms and in the video, the teacher mentions that BFS/DFS can' ... question and this question. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
674 views
1 answer
    How to optimally divide an array into two subarrays so that sum of elements in both subarrays is same, otherwise ... arrays of an equal sum. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
527 views
1 answer
    I was looking around stackoverflow Non-Trivial Lazy Evaluation, which led me to Keegan McAllister's presentation: ... the explanation behind it? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
520 views
1 answer
    I'm practicing algorithms and one of my tasks is to count the number of all longest increasing sub-sequences for given 0 < ... 10,15 | 1,2,3,4) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
667 views
1 answer
    This is one of an interview question which I had recently. I would like to know others perception of approach for ... should be done in-place). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
639 views
1 answer
    Suppose you are given an mXn bitmap, represented by an array M[1..m,1.. n] whose entries are all 0 ... help me find a more efficient solution? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
408 views
1 answer
    Find minimum window width in string x that contains all characters of another string y. For example: String x = " ... should both be O(1). See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
521 views
1 answer
    What is the complexity of the log base 10 function? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
617 views
1 answer
    Please, provide code examples in a language of your choice. Update: No constraints set on external storage. ... disk for intermediate results. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
622 views
1 answer
    I've been coding up a bunch of different binary search tree implementations recently (AVL, splay, treap) and ... that could indeed handle this. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
844 views
1 answer
    My professor just taught us that any operation that halves the length of the input has an O(log(n)) complexity ... 't both of them equivalent? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
525 views
1 answer
    I am trying to solve this recurrence T(n) = 3 T(n/2) + n lg n .. I have come to the solution that it ... something here? Isn't nlgn O(n^2) ? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
673 views
1 answer
    This problem was asked to me in Amazon interview - Given a array of positive integers, you have to find the smallest ... than O(n log n) time. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
585 views
1 answer
    Let's take this implementation of Merge Sort as an example void mergesort(Item a[], int l, int r) { if (r <= ... will always be O(n) or worse. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
453 views
1 answer
    This earlier question asked for the differences between 4 different Git diff strategies, but the only difference ... backend for patience?) See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
503 views
1 answer
    I came across an interesting algorithm question in an interview. I gave my answer but not sure whether there is any ... . Any ideas guys? Steve. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
598 views
1 answer
    Given an array of integers, find the local minima. An element A[i] is defined as a local minimum if A[i-1] > A ... be solved in O(log n) time? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
556 views
1 answer
    Write an algorithm to find F(n) the number of bits set to 1, in all numbers from 1 to n for any given ... can only design an O(n) algorithm. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
606 views
1 answer
    I am reading an article on amortized analysis of algorithms. The following is a text snippet. Amortized analysis ... is valid? Thanks! See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
631 views
1 answer
    I am working on an application that demonstrates the Djikstra's algorithm, and to use it, I need to restore the ... on how this should be done. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
591 views
1 answer
    I need a function like this: // return true iff 'n' is a power of 2, e.g. // is_power_of_2(16) => ... where this sort of algorithm can be found? See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
551 views
1 answer
    There are a few similar questions on stackoverflow, but none of them seem to provide a tangible answer that ... of the bin packing method. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
649 views
1 answer
    While trying to understand the difference between Theta and O notation I came across the following statement : The ... , yet powerful examples. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...