什么是算法? [英] what is the algorithm?

查看:88
本文介绍了什么是算法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

银行队列系统FİFO首先开始工作吗?



但是有特殊客户他们没有排队等候,他们出来但他们去了首先。





这种队列系统的算法算法是什么?



我们将只使用一个队列,没有大量队列。

bank queue sistem has work FİFO first in first out wright?

but there is special customers they have not wait in the queue, they comes out but they goes first.


what is the algorithm this kind of queue sistem?

we will use only one queue there is no lots of queue.

推荐答案

您可能正在寻找优先级队列。请参见 http://en.wikipedia.org/wiki/Priority_queue [ ^ ]。
You might be looking for a Priority Queue. See http://en.wikipedia.org/wiki/Priority_queue[^].


这称为优先级队列,队列中的项目是先按优先级编号处理,然后按FIFO顺序处理。
This is called a priority queue, items in the queue are processed by their priority number first then FIFO order.


答案安德烈亚斯& Mehdi很好,你可能想调查 MSMQ [ ^ ]或类似的东西。



MSMQ允许您设置消息的优先级,并允许您安全地保留队列中的元素。当你处理钱时,这通常很重要。你真的,真的不想忘记钱 - 所以你的处理管道的每一步都应该是交易和持久。



最好的问候

Espen Harlinn
While the answers Andreas & Mehdi are good, you may want to investigate MSMQ[^] or something similar too.

MSMQ allows you to set the priority of messages, and it allows you to safely persist the elements in the queue. This is often important when you are handling money. You really, really don't want to loose track of money - so each step of your processing pipeline should be both transacted and persisted.

Best regards
Espen Harlinn


这篇关于什么是算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆