Efficient Algorithms with Neural Network Behavior