Weekly Summary <3>

Source: Internet
Author: User

After a week of learning, we learned about new knowledge points in HTML and C, including the introduction of computers and the setting up of routers.

Html

Mouse events

C

Traversal codes for binary trees

Introduction to Computers

Settings for the router

HTML case:

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>

<title> Untitled Document </title>

<script type= "Text/javascript" >

function Mousein ()

{

Document.bgcolor= "Red";

}

function MouseOut ()

{

Document.bgcolor= "Blue";

}

var x=0,y=0;

function Move ()

{

X=window.event.x;

Y=window.event.y;

window.status= "X:" +x+ "" + "Y:" +y+ "";

}

Document.onmousemove=move;

function Keypree ()

{

Switch (Window.event.keyCode)

{

Case 119:document.bgcolor= "Blue";

Break

Case 97:document.bgcolor= "Yellow";

Break

}

}

Document.onkeypress=keypree;

</script>

<body bg>

<input type= "button" value= "Change background color" onmousedown= "Mousein ()" onmouseup= "MouseOut ()"/>

</body>

C Language Case:

#include "stdafx.h"

#include "stdio.h"

#include "Stdlib.h"

typedef char DataType;

typedef struct node{

DataType data;

struct Node *lchild, *rchild;

}*bitree;

/* First ORDER traversal */

void preorder (Bitree root)

{

if (root!=null)

{

printf ("%c", root->data);//Access root node

Preorder (Root->lchild);

Preorder (Root->rchild);

}

}

/* Middle Sequence traversal */

void Inorder (Bitree root)

{

if (root!=null)

{

Inorder (Root->lchild);

printf ("%c", root->data);//Access root node

Inorder (Root->rchild);

}

}

/* post-traversal */

void Postorder (Bitree root)

{

if (root!=null)

{

Postorder (Root->lchild);

Postorder (Root->rchild);

printf ("%c", root->data);

}

}

int main (int argc, char* argv[])

{

printf ("303 Liu Xiaoya traversal \ n");

int i;

Bitree T[10];

t[1]= (bitree) malloc (sizeof (*t[0));

t[2]= (bitree) malloc (sizeof (*t[0));

T[1]->data= ' A ';

T[2]->data= ' B ';

for (i=3;i<=9;i++)

{

t[i]= (bitree) malloc (sizeof (*t[0));

T[i]->data= ' A ' +i;

t[i]->rchild=null;

t[i]->lchild=null;

}

t[1]->lchild=t[2]; t[1]->rchild=t[3];

t[2]->lchild=t[4]; t[2]->rchild=t[5];

t[5]->lchild=t[8]; t[5]->rchild=t[9];

t[3]->lchild=t[6]; t[3]->rchild=t[7];

printf ("First Order Traversal:");

Preorder (t[1]);

printf ("\ n");

printf ("Middle order Traversal:");

Inorder (t[1]);

printf ("\ n");

printf ("post-post traversal:");

Postorder (t[1]);

printf ("\ n");

return 0;

}

Weekly Summary <3>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.