Public keys I have generated public keys for each of you. You can download the public keys here: public-keys.tgz (hps:/umd.instructure.com/courses/1358965/files/78500682?wrap=1) (hps:/umd.instructure
//How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min should all operate in O(1) time.//使用一个链表来记录最小值的index
//How would you design a stack which, in addition to push and pop, also has a function min which returns the minimum element? Push, pop and min should all operate in O(1) time.//使用一个链表来记录最小值的index
这题的思想来自于http://hawstein.com/posts/2.5.html,重新实现了一下 用hash来记录循环的起点 //Given a circular linked list, implement an algorithm which returns node at the beginning of the loop.//DEFINITION//Circula
删除前面的linklist,使用node来表示链表 // You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1’s digit is at the head
//Assume you have a method isSubstring which checks if one word is a substring of another. //Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to isSubst
//Assume you have a method isSubstring which checks if one word is a substring of another. //Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one call to isSubst
//Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.////这题原答案就是要两个buffer来记录出现0的位置。不知道有没可以不用buffer的方法。#include <iostream>using namespace std;vo
//Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column is set to 0.////这题原答案就是要两个buffer来记录出现0的位置。不知道有没可以不用buffer的方法。#include <iostream>using namespace std;vo
//原文://// A circus is designing a tower routine consisting of people standing atop one another’s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the
//原文://// Given a matrix in which each row and each column is sorted, write a method to find an element in it.// 从最右一排,从上到下,小于右上角的元素则下降,大于右上角的元素则左移找;第一个相等的元素。#include <iostream>using namespace s