Top "Time-complexity" questions

The time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the size of the input to the problem.

Why do we use linear probing in hash tables when there is separate chaining linked with lists?

I recently learned about different methods to deal with collisions in hash tables and saw that the separate chaining with …

performance algorithm hash hashtable time-complexity
Time complexity of the Ford-Fulkerson method in a flow network with unit capacity edges

Will the Ford-Fulkerson algorithm find a maximum flow of a unit-capacity flow network (all edges have unit capacity) with n …

algorithm time-complexity network-flow ford-fulkerson
Java Data Structures Reference

Can anyone give me references of a web site containing a summary of the main Java data structures, and their …

java data-structures time-complexity summary
Why does the time complexity of DFS and BFS depend on the way the graph is represented?

The site http://web.eecs.utk.edu/~huangj/CS302S04/notes/graph-searching.html describes that when an adjacency list is …

data-structures graph time-complexity graph-algorithm breadth-first-search
Time complexity of memory allocation

What is the time complexity of dynamic memory allocation using new, malloc, etc.? I know very little about how memory …

optimization memory-management malloc time-complexity
Is the runtime of BFS and DFS on a binary tree O(N)?

I realize that runtime of BFS and DFS on a generic graph is O(n+m), where n is number …

algorithm binary-tree time-complexity depth-first-search breadth-first-search
Can a Fibonacci function be written to execute in O(1) time?

So, we see a lot of fibonacci questions. I, personally, hate them. A lot. More than a lot. I thought …

algorithm floating-point time-complexity fibonacci
Why does heap sort have a space complexity of O(1)?

I understand that both quick sort and merge sort need O(n) auxiliary space for the temporary sub-arrays that are …

sorting complexity-theory time-complexity
Time complexity of System.arraycopy(...)?

System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length) is a native method. What is the time …

java algorithm time-complexity
How to optimize Knight's tour algorithm?

I code the Knight's tour algorithm in c++ using Backtracking method. But it seems too slow or stuck in infinite …

c++ algorithm optimization time-complexity backtracking