b********n 发帖数: 38600 | 1 【 以下文字转载自 Military 讨论区 】
发信人: beijingren (to thine own self be true), 信区: Military
标 题: Geoge Washington 对 NuttaYahoo的评价
发信站: BBS 未名空间站 (Tue Dec 27 14:29:44 2016, 美东)
Netanyahu's actions illustrate something that George Washington said in his
Farewell Address:
http://avalon.law.yale.edu/18th_century/washing.asp
"In the execution of such a plan, nothing is more essential than that
permanent, inveterate antipathies against particular nations, and passionate
attachments for others, should be excl... 阅读全帖 |
|
p******1 发帖数: 1388 | 2 you paid doubly than others.....
some service not necessary
also |
|
i****x 发帖数: 17565 | 3 冯诺依满的贡献早就不能用钱衡量了 别的不说,没他对eniac的工作,程序员这个职业
就不会存在。gates要是知道你把他俩比,估计都要被折杀了。
wiki上列了他的主要贡献领域,给你参考下
Abelian von Neumann algebra
Affiliated operator
Amenable group
Arithmetic logic unit
Artificial viscosity
Axiom of regularity
Axiom of limitation of size
Backward induction
Blast wave (fluid dynamics)
Bounded set (topological vector space)
Class (set theory)
Decoherence theory
Computer virus
Commutation theorem
Continuous geometry
Direct integral
Doubly stochastic matrix
Duality Theorem
Density matrix
... 阅读全帖 |
|
l******n 发帖数: 9344 | 4 Detection of two-component mixtures of lognormal distributions in grouped,
doubly truncated data: Analysis of red blood cell volume distribution
1991
C.E. Mclaren, M. Wagstaff
to f********[email protected]
baozi
thanks |
|
f*********r 发帖数: 68 | 5 just like the problems for the doubly linked list is much easier than the
same problem for the singly linked list. |
|
b*********n 发帖数: 1258 | 6 对于第2条,插入一个element的时候,应该放到head,不是tail吧
其次,应该是一个doubly link list,对吧.
up |
|
c*****y 发帖数: 90 | 7 谢谢大家。再问个递归的方法,如何reverse doubly linked list? |
|
c*****y 发帖数: 90 | 8 Reverse a doubly linked list.
Node *RevDList(Node *head)
{
if (head==NULL) return head;
Node *temp = head->Next;
head->Next = head->Prev;
head->Prev = temp;
if (!temp) return head;
return RevDList(temp);
} |
|
R***r 发帖数: 120 | 9 Why not use hash table? Store each data in the hash table as a doubly linked
list node where next and previous pointers are the hash key. When reading a
node, move it to the head. Add to head and delete from tail. Timestamp is
not necessary. |
|
e********c 发帖数: 66 | 10 Map.Entry has two attributes in HashMap. With LinkedHashMap, each
node has two additional fields: before and after to form a doubly linked
list. The implementation is the same as any Hashtable but you need to update
before and after nodes accordingly upon insertion and deletion.
You can take a look at the implementation in SUN's JDK source code. |
|
j**l 发帖数: 2911 | 11 Design question, use hashtable + doubly linked list to implement LRU cache |
|
f*********5 发帖数: 576 | 12 what is the difference between singly and doubly? |
|
B*****p 发帖数: 339 | 13 来自主题: JobHunting版 - ms面试题 Write a function to convert a Binary Search Tree into a sorted doubly linked
list. The algorithm should be done
in place. left becomes prev, and right becomes next
唉,没答出来 |
|
f*********5 发帖数: 576 | 14 来自主题: JobHunting版 - ms面试题 其实就是一个recursion,利用了BST是一个sorted data structure的缺省条件
root的左子树所有node得值都比root的值小,
将其转化为sorted doubly linked list,放在当前节点前面。
。。。
linked |
|
g**e 发帖数: 6127 | 15 发一个我昨天写的
private static void join(Node a, Node b) {
a.right = b;
b.left = a;
}
/**
helper function -- given two circular doubly linked
lists, append them and return the new list.
*/
private static Node append(Node a, Node b) {
if (a==null) return b;
if (b==null) return a;
Node aLast = a.left;
Node bLast = b.left;
|
|
y*********e 发帖数: 518 | 16 BST to Doubly Linked List:
public LinkedList convert(BTree tree) {
LinkedList list = new LinkedList();
convert(tree, list);
return list;
}
private void convert(BTree tree, LinkedList list) {
if (tree != null) {
convert(tree.getLeftChild(), list);
LinkedListNode node = new LinkedListNode(tree.getValue());
list.add(node); // append to tail
convert(tree.getRightChild(), list);
}
}
看起来很眼熟把?就是in-order的tree traverse而已。
至于LinkedList的实现。。
public cl |
|
y*********e 发帖数: 518 | 17 Doubly Linked List to Balanced BST:
取LinkedList的中间Node,那就是BST的Root。LinkedList的前半部分,就是BST的Left
Child;后半部分,就是BST的
Right Child。用递归。
public BTree convert(LinkedList list) {
if (list.size() > 0) {
// partition it into three parts: left, middle, right
Partition parts = partition(list);
LinkedList leftList = parts.getLeftSubList();
LinkedList rightList = parts.getRightSubList();
LinkedListNode middle = parts.getMiddle();
BTree root = new BTree( |
|
h**k 发帖数: 3368 | 18 把它从链表中删除,再重新插到链表最后就行了。因为是doubly link,操作是O(1)。 |
|
h**k 发帖数: 3368 | 19 他用的是doubly linked list。一般是有一个专门指向tail的指针。
LRU值不是必须的,但是你必须知道request的先后顺序。
maintain
paul |
|
j*****g 发帖数: 223 | 20 总结一下面试的准备活动,希望有帮助.
==================== AREAS/TOPICS to study/prep/review ====================
复习的东西还挺多的。比不过刚毕业的呀 :), 脑子不好使了,东西也差不多忘光了...
嘿嘿....
• Sorting
o Bubble/select/insertion/counting/qsort/heap/merge/bst
o Time/space complexity analysis
• Caching design
o Replacement policy (LRU, LFU, NRU, etc…)
o Efficiency/complexity/performance
o Distributed cache
o Hashing
• Multi-thread
o Locking/mutex/semaphore/critical sec... 阅读全帖 |
|
j*****g 发帖数: 223 | 21 总结一下面试的准备活动,希望有帮助.
==================== AREAS/TOPICS to study/prep/review ====================
复习的东西还挺多的。比不过刚毕业的呀 :), 脑子不好使了,东西也差不多忘光了...
嘿嘿....
• Sorting
o Bubble/select/insertion/counting/qsort/heap/merge/bst
o Time/space complexity analysis
• Caching design
o Replacement policy (LRU, LFU, NRU, etc…)
o Efficiency/complexity/performance
o Distributed cache
o Hashing
• Multi-thread
o Locking/mutex/semaphore/critical sec... 阅读全帖 |
|
l*****a 发帖数: 559 | 22 这么做,插入和删除操作也需要对'数组或者list'进行维护,那么插入和删除就不能是
O(1)了。
doubly |
|
|
b********n 发帖数: 609 | 24
double-
u can say all associate containers are implemented on memory blocks, but
that's not an answer. u should've said deque is double ended queue,
usually implemented by dynamic array or doubly-linked list. |
|
i**********e 发帖数: 1145 | 25 Thanks for the link.
According to AprilFlower:
>> 永远是从尾插入的,只要O(1)的。
如果要插入的数比当前尾部数大,要删除前面的数直到遇到比当前数大的再插入,链表
maintain的是一个递减的序列,并不是整个window的大小,也就是每个数最多插入/删
除一次,所以整个的复杂度是O(n)。。
I think I coded the solution and submitted here at POJ online judge:
http://poj.org/problem?id=2823
I uploaded a copy of my code here (Sorry it's a bit messy and there's part
that I copy and paste here and there :( ) The basic idea is using a doubly-linked list and maintain the linked list by only doing insert/remove operatio... 阅读全帖 |
|
l*****g 发帖数: 685 | 26 这个提以前讨论过的
用doubly-linked list表示P1, P2, ..., Pn (--> P1 again)的环
任意点出发做traverse, 譬如从P1开始,做clockwise的计算; 如果全程走通,回到P1,
那问题就解决了。
如果只走到Pi,走不到Pi+1,那下一次就选择 Pi+1做为出发点,再做类似计算。直到
找到结果,或者回到P1.
再换成counter-clockwise, 同样地找符合条件的点。
the
amount
you
between
and
your |
|
M7 发帖数: 219 | 27 来自主题: JobHunting版 - MS面经。 没说清楚,是 doubly circular LL.
一个interviewer很明确地说,SDET进来后很多都转成SDE或者PM了。 |
|
h**k 发帖数: 3368 | 28 这里用来保存minimums的不能是queue,因为queue严格讲只提供了两个操作,从前面
pop()和从后面push()。你不能从一
个queue的后面pop。这里可以用doubly linked list来做这个。 |
|
l*******x 发帖数: 11 | 29 a公司在我们学校是所有面试都学校解决。面试过后几个小时得知拿到了offer。主要是
题目确实非常基本。on campus的面试就3个engineer,每个人45分钟,一般都先寒暄一
下,然后出题,说算法,写完整的代码。下面奉上面筋:
1。 问问原来的项目,遇到的挑战,引以为豪的东西。这个好像得塞的时间比较多。。
。题目是实现一个stack, pop, push, getmin
地球人都知道是O(1)时间,我用两个doubly linked list实现的,一个是存每个节点,
一个track 当前的min
2。 也问了问原来做的项目。题目是逆时针打印二叉树的最外边的点。就是先left-
left,然后从左到右打印叶子,然后是最右面的点。需要主意的是左下角,右下角,根
节点别打印重复了。
3。 千年不变的why a? 实现开方函数。binary search就行了。 还有就是两个数组的
交集。hash_map就行了
题应该说有点过于基本,这回算是走狗屎运了。总体感觉就是要求一定的熟练读,因为
除去得塞的时间以及给面试官讲算法的时间,写代码的时间不是太充裕,我觉得我基本
就是一直在写。然后能... 阅读全帖 |
|
l*****g 发帖数: 685 | 30 最近Amazon面试好像喜欢问LRU (least recently used cache)的设计
我用doubly-linked list 和 hashtable 实现了一个简单的LRU, 抛砖引玉,供大家做
参考。祝大家都顺利拿到offer.
using System;
using System.Collections.Generic;
namespace LRU
{
public class Cache
{
public class Container
{
public Object obj;
public Container next;
public Container prev;
public Container(object o)
{
this.obj = o;
}
}
private const int MaxSize ... 阅读全帖 |
|
E***n 发帖数: 166 | 31 但是使用doubly linked list每插入一个元素,需要O(n)时间,
而minheap,插入新的元素只需要O(log n)时间(reheap)
timestamp
implement |
|
r******r 发帖数: 700 | 32 我当年的 homework,翻出来了。另一个 homework project, 帮我找到了第一个工作。
#ifndef LIST_H
#define LIST_H
#include
#include
#include
#include "node.h"
using namespace std;
/*=========================================================================*/
/**
* Implementation of a List ADT using a doubly-linked list.
*
* @version 1.0 2/25/05
*/
/*.........................................................................*/
/**
* Definition of exception handling class
*/
class ListEmpty : public ... 阅读全帖 |
|
|
|
s*****y 发帖数: 897 | 35 在网上找到一个merge的算法,很牛B,短短几行code就merge好了,verify过是work的
Tree *insert_node_in_tree(Tree *t1 , Tree *t2)
{
if(t1==NULL)
{
t2->left=NULL;
t2->right=NULL;
return t2;
}
if(t2->elementelement)
{
t1->left = insert_node_in_tree(t1->left , t2);
return t1;
}
else if(t2->element > t1->element)
{
t1->right = insert_node_in_tree(t1->right , t2);
return t1;
}
else
{
printf("Duplicate , here you can dele... 阅读全帖 |
|
c**z 发帖数: 669 | 36 1. how to form a doubly circular list using a binary tree.
2. how to use a stack to form a queue |
|
s******d 发帖数: 61 | 37 public void reverse(){
DoubleNode start=head;
DoubleNode temp=null;
while(head!=null){
temp=head.getNext();
head.setNext(head.prev);
head.setPrev(temp);
if(head.getPrev()==null){
head.setPrev(start);
break;
}
head=head.getPrev();
}
}
If I reverse onece, it prints successfully. While I reverse again, it prints
nothing.
Appreciate your help! |
|
f*********5 发帖数: 576 | 38 需要明确每次返回什么样的number.
如果随便的话
1)这个题跟实现LRU有点像
doubly linked list+hashtable
use hashtable to judge whether the number is in them
use linked list to add new number and return a number
2)也可以用stack+hashtable
each time just push/pop stack and update hashtable
You
in |
|
f*********5 发帖数: 576 | 39 需要明确每次返回什么样的number.
如果随便的话
1)这个题跟实现LRU有点像
doubly linked list+hashtable
use hashtable to judge whether the number is in them
use linked list to add new number and return a number
2)也可以用stack+hashtable
each time just push/pop stack and update hashtable
You
in |
|
j********x 发帖数: 2330 | 40 doubly-linked list很好探测环 |
|
w***o 发帖数: 6775 | 41 DLL是double ended 还是doubly linked list ? |
|
g*********8 发帖数: 64 | 42 你是不是可以把每一道题都Code (白板和编译器),保证没有bug(尽可能),然后可以
用一到两句话把这道题的关键点写下来或者说出来了。
举个例子:Binary tree non-recursive in-order traverse
代码是什么?
关键点是什么?
可能的bug
应用:in-order traverse应用很普遍啊,比如判断一个BT是不是BST,把BT转成
doubly-linked list,上面的problem可不可以不用stack?(这些都要写代码的哦)
P.S.: 遇到不会的题是正常的,不用指望你能找到一个封闭的集合,只要搞定它就可以
万事OK |
|
x*********n 发帖数: 46 | 43 node->prev->next = node->next;
node->next->prev = node->prev;
free(node); |
|
i**p 发帖数: 902 | 44 this solution loses the pointer to the link. |
|
i**********e 发帖数: 1145 | 45 No it is correct.
It only reposition its previous's next and next's prev node.
the current node still has reference from the pointer.
However, the solution above did not check for NULL (ie, prev or next node
might be NULL). |
|
i**********e 发帖数: 1145 | 46 Another more interesting problem is to remove a node from a singly linked
list in constant time. |
|
i**p 发帖数: 902 | 47 For example, we are giving a pointer to the node to be removed. Once the
removing is done, the pointer is pointed to null. We lose the reference to
the list. |
|
l*****a 发帖数: 14598 | 48 能说一下你原题的pointer指向什么吗?
删掉结点之后又准备指向什么? |
|
i**p 发帖数: 902 | 49 In the beginning the pointer points to the node to be removed. After the
node is removed, the pointer needs to point some node in the list so that we
can access the list by the pointer. |
|
i**********e 发帖数: 1145 | 50 There should be two nodes referencing the list.
One is the node pointing to the node you want to delete, the other point to
the head of the list.
we |
|