题目链接POJ 2051
题目描述(Description)Argus
Argus是一个数据流管理系统,可以在数据流上处理多个query。Argus接收的查询指令格式如下:
Register Q_num Period
Q_num (0 < Q_num <= 3000)是查询ID号码,Period(0<period<=300)是两个查询结果之间的时间间隔。一旦一个ID号码被注
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            题目链接:Rotate Array
题目描述(Description)Rotate Array 
Rotate an array of n elements to the right by k steps.
For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].
Note
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            题目描述给出大量的字符串,每个字符串的字符数不超过30,字符串可能有重复,请统计每个字符串出现的频率(保留到小数点后第四位),并按字典序打印结果。
分析字符串数量太多,如果按照定义一个数组然后逐个统计的思路,查找的时间复杂度很高o(n)。根据二叉搜索树的特点,如果把所有字符串构造成一个二叉搜索树,那么按中序遍历出来的结果就是字典序,查找的时间复杂度就减为o(logn)。
这里主要涉及二叉搜索树的两
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            题目链接
Validate Binary Search Tree
题目描述(Description)Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left su
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            第二章//my first.cpp
#include<iostream>        //头文件
int main()                //函数头
{                        //函数体的开始
    using namespace;    //命名空间,使定义可见
    cout<<"Hello";        //打印信息到屏
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            题目链接:
Binary Tree Preorder Traversal
Binary Tree Postorder Traversal
Binary Tree Inorder Traversal
二叉树遍历(Traversing binary tree)常见的有三种遍历方式:
前序遍历(Pre-Order Traverse):若二叉树为空,返回空操作;否则先访问根节点,然后前序遍历左子
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            分析从A/B到C总共有两种可能,A->B->C或者B->A->C
代码#include<stdio.h>
void hanio(int n,char A,char B,char C)
{
    if(n==1){
        hanio(n,A,B,C);
        printf("Move dist %d from %c to %c",n,A,C)
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            书籍信息:《C++ Primer Plus》第6版 Stephen Prata著 张海龙 袁国忠 译
本科阶段开设了C语言基础编程,对于即将进行计算机专业的研究生学习和研究,我发现C++是一道不得不迈过去的槛,而且相比C的刻板,c++更加灵活,所以选择了《C++ Primer Plus》这本入门级的书自学C++。
C语言的诞生20世纪70年代早期,贝尔实验室的Dennis Ritchie致力于开发
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            题目链接:reverse-linked-list-ii
题目描述Reverse Linked List II
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4
            ...
          
          
        
      
     
    
  
    
      
  
    
    
      
      
      
        
          
            
            准备用Markdown编写并在本地查看
把下列代码加入HTML文件<head>``</head>中(在MarkdownPad中通过点击“工具->选项->高级->HTML head编辑器->在弹出框里输入”:
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
tex2
            ...