数据结构外文翻译外文文献英文文献.doc_第1页
数据结构外文翻译外文文献英文文献.doc_第2页
数据结构外文翻译外文文献英文文献.doc_第3页
数据结构外文翻译外文文献英文文献.doc_第4页
数据结构外文翻译外文文献英文文献.doc_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

外文翻译原文computer programming data structure is an important theoretical basis for the design, it is not only the core curriculum of computer disciplines, and has become a popular elective course other polytechnic professional, so studied this course well and studied computer are closely related.一、the concept of data structurecomputer data structure is the foundation of science and technology professional classes, is the essential core curriculum. all computer system software and application software to use various types of data structures. therefore, if we want to make better use of computers to solve practical problems, only to several computer programming languages are difficult to cope with the many complex issues. to the effective use of computers, give full play to computer performance, but also must learn and master relevant knowledge of data structure. a solid foundation of data structure for learning other computer professional courses, such as operating systems, translation theory, database management systems, software engineering, artificial intelligence, etc. are very useful.二、why should learn from data structure?in the early development of computers, the use of computer designed primarily to deal with terms. when we use the computer to solve a specific problem, the following general needs through several steps : the first is a specific problem of appropriate abstract mathematical models, and then design or choose a mathematical model of the algorithm,the final procedures for debugging, testing, until they have the ultimate answer. since then the object is integer, real, boolean, the procedures of the main designers of energy is focused on programming skills, without attention to the data structure. with the expansion of computer applications and development of software and hardware, the issue of non-terms increasing importance. according to statistics, now dealing with the issue of non-occupancy of more than 90% of the machine time. such issues involve more complex data structure, the relationships between data elements generally can not be described by mathematical formula. therefore, the key to solving such problems is no longer mathematical analysis and calculations, but to devise appropriate data structure, can effectively address the problem. description of the terms of such non-mathematical model is not a mathematical equation, but such as tables, trees, such as map data structure. therefore, it can be said that data structure courses primarily designed to study the issue of non-value calculation procedures as a computer operations and the relationship between objects and their operating disciplines. the purpose of the study is to understand the structure of data for computer processing of the identity object to the practical problems involved in dealing with that subject at the computer out and deal with them. at the same time, through training algorithms to improve the thinking ability of students through procedures designed to promote student skills integrated applications and professional qualities.三、the concepts and terminologysystematic study of knowledge in the data structure before some of the basic concepts and terminology to give a precise meaning. data (data) is the information carrier, it could be computer identification, storage and processing. it is the computer processing of raw materials, a variety of data processing applications. computer science, computer processing is the so-called data objects, which can be numerical data can be non - numerical data. numerical data are integer, the actual number or plural, mainly for engineering computing, scientific computing and commercial processing; non - numerical data, including characters, text, graphics, images, voice and so on.data elements (data element) is the basic unit of data. in different conditions, data elements can be called elements, nodes, the peak, recording. for example, students information retrieval system table information, a record high, 8 queens issue of a state tree, teaching programming issues such as a peak, known as a data element. sometimes, a data from a number of data elements (data item), for example, the student information management system students each data element table is a student record. it includes students of the school, name, sex, nationality, date of birth, performance data items. these data items can be divided into two types : one called early such as student gender, origin, etc., these data were no longer divided in data processing, the smallest units; another called portfolio, the performance of students who, it can be divided into mathematics, physics, chemistry and other smaller items. normally, in addressing the question of the practical application of each student is recorded as a basic unit for a visit and treatment.data objects (data object) or data element type (data element class) is the nature of the data elements with the same pool. in a specific issue, the data elements have the same nature (not necessarily equal value elements), belonging to the same data objects (data element type), the data element is an example of such data elements. for example, traffic information systems in the transportation network, is a culmination of all the data elements category, peak a and b each represent an urban middle is the data elements of the two types of examples of the value of their data elements a and b respectively. data structure (data structure) refers to the mutual relationship that exists between one or more data elements together. in any case, between data elements will not be isolated in between them exist in one way or another, such as the relationship between the data element structure. according to the data elements of the relationship between different characteristics, usually have the following four basic categories of the structure : 1 assembly structures. in the assembly structure, the relationship between data elements is belonging to the same pool. assembly elements relations is a very loose structure. 2 linear structures. the structure of the data elements exist between one-to-one relationship. 3 tree structure. the structure of the data elements exist between hierarchical relationship. 4graphics structure. the structure of the data elements of the relationship that existed between duoduiduo, graphics structure also known as network structure.c+builder programming experience一、database programmingand the use of delphi, borland c+builder bde (borland database engine) database interface, in particular its use bde administrator unified management database alias, the database operation has nothing to do with the location of the database documents, thus enabling database development easier operation. but in a database application procedures at the same time we have to release bde, the database for some simple procedures may bde than our own design procedures big, but as the use of bde installshield, add database alias is likely allocation failure. therefore, we can use the following methods : still in the design stage procedure using bde alias management database for debugging, but in procedures substantially (as in the main chuangti oncreate event processing function) to table components databasename attributes, such as the use of similar phrases as follows : table1-databasename = extractfilepath (application-exename); or table1-databasename = extractfilepath (application-exename+ db);thus, no impact on the debugging phase, will be issued if the application procedures table1 document on the use of databases or their current catalogue db virus, database procedures can be normal operation. you can even be a database to catalogue the documents in the form of character string register (installed in the installation process), then the procedure in the acquisition of substantially from the catalogue of payrolls, fuzhi databasename attribute to be. anyway, you do not need to install relatively large bde forced users.二、the registry visitas in the design process we often required 9x/nt windows registry information visit, such as retrieval of information procedures, preservation of information. register write a subroutine to visit necessary. when the register to visit, the library will be directly available without always some duplication operation. the following can be used to access cosmetic licheng, the character string type jianzhi, and the retrieval of failure to return default value default.#include int readintfromreg(hkey root, ansistring key,ansistring keyname, int default) int keyvalue;tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, false);try keyvalue = registry-readinteger(keyname);catch(.) keyvalue = default;delete registry;return keyvalue;void saveinttoreg(hkey root, ansistring key,ansistring keyname, int keyvalue) tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, true);registry-writeinteger(keyname, keyvalue);delete registry;char *readstringfromreg(hkey root, ansistring key,ansistring keyname, char *default) ansistring keyvalue;tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, false);try keyvalue = registry-readstring(keyname);catch(.) keyvalue = (ansistring)default;delete registry;return keyvalue.c_str();void savestringtoreg(hkey root, ansistring key, ansistring keyname, char *keyvalue) tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, true);registry-writestring(keyname, (ansistring)keyvalue);delete registry; we may use the following access methods (to windows wallpaper documents) :ansistring wallpaperfilename = readstringfromreg(hkey_current_user,control paneldesktop, wallpaper, );三、show / hide icons task column standard windows applications generally operating in the mission mandate column on the chart shows, users can directly use the mouse clicking column logo for the mission task cut over, but some applications do not use task column signs, such as the typical office tools, there are also procedures that can be shown or hidden customization tasks column icon, such as winamp. we can do the procedure, as long as access windows setwindowlong function can drive, as follows : / hidden task column chart : setwindowlong (application-handle. gwl_exstyle, ws_ex_toolwindow); / task column shows signs : setwindowlong (application-handle. gwl_exstyle, ws_ex_appwindow);四、the establishment of a simple on windowa complete windows applications typically contain a on the window to show version information. we customized a dialog box as usual on the window of the on free customized window, indicates that more information, even including super links. if only show simple version information, windows shellabout function shelf items have sufficient, following this line of code can be on duihuakuang and is windows standard on the duihuakuang and procedures may show signs such as the use of resources and systems. shellabout (handle, ( on +application-title+ #). c_str () ( n +application-title+ v1.0nn + 夏登城 版权所有!). c_str () application-icon-handle);五、the two methods to choice cataloguein our applications, allowing users to choose the regular catalogue, such as software manufacturers, users choose catalogue. this involves catalogue option, we may use the following methods for users to choose one of the catalogue : 1, use shbrowseforfolder and shgetpathfromidlist function; company affirms its function as follows : winshellapi lpitemidlist winapi shbrowseforfolder(lpbrowseinfo lpbi); winshellapi bool winapi shgetpathfromidlist(lpcitemidlist pidl, lpstr pszpath); lpbrowseinfo和lpitemidlist structure refer win32 files. this method of selecting catalogues available windows desktop all available inventory, including networks of other computers sharing catalogue neighbors, but not the new catalogue. li cheng allows users to choose the following directory, the directory of choice licheng return at all trails character string.#include char *getdir(char *displayname, hwnd owner) char dirmax_path = ;browseinfo *bi = new browseinfo;bi-hwndowner = owner;bi-pidlroot = null;bi-pszdisplayname = null;bi-lpsztitle = displayname;bi-ulflags = bif_returnonlyfsdirs;bi-lpfn = null;bi-lparam = null;bi-iimage = 0;itemidlist *il = shbrowseforfolder(bi);if(il!=null) shgetpathfromidlist(il, dir);delete bi;return dir;we can use the following list to be chosen from : ansistring at dir = (ansistring) getdir ( please select catalogue : handle);2, the use of selectdirectory function. c+builder the function selectdirectory achievable catalogue of options, which showed that similar open / preserve duihuakuang, but its advantage is to use / non-use keyboard input catalogue members, and allow the creation of new directories. its original definition as follows : extern package bool _fastcall selectdirectory ( ansistring &directory, tselectdiropts options, 103-116 helpctx); licheng selectdir allow you to choose the following directory : #include ansistring selectdir(ansistring dir) if(selectdirectory(dir, tselectdiropts() sdallowcreate sdperformcreate databasename = extractfilepath(application-exename);或 table1-databasename = extractfilepath(application-exename+”db”); 这样,对调试阶段没有什么影响,发布应用程序时只要将table1使用的数据库文件放在当前目录或其“db”子目录下,数据库程序即可正常运行。甚至您还可以将数据库文件所在目录以字符串形式写入注册表(可在安装程序中设置),然后在程序初始化时从注册表获取目录名,赋值给databasename属性即可。无论怎样,您不必强迫用户安装相对庞大的bde了。二、 注册表存取 在我们在设计windows 9x/nt程序时经常需进行注册表信息的存取,如读取程序配置信息、保存配置信息等。写一个注册表存取子程序就很有必要。当需存取注册表时,直接调用此子程序即可,而不必每次都重复一些操作。下面的例程可用来存取整型、字符串型键值,并可在读取失败时返回缺省值default。 #include int readintfromreg(hkey root, ansistring key,ansistring keyname, int default) int keyvalue;tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, false);try keyvalue = registry-readinteger(keyname);catch(.) keyvalue = default;delete registry;return keyvalue;void saveinttoreg(hkey root, ansistring key,ansistring keyname, int keyvalue) tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, true);registry-writeinteger(keyname, keyvalue);delete registry;char *readstringfromreg(hkey root, ansistring key,ansistring keyname, char *default) ansistring keyvalue;tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, false);try keyvalue = registry-readstring(keyname);catch(.) keyvalue = (ansistring)default;delete registry;return keyvalue.c_str();void savestringtoreg(hkey root, ansistring key, ansistring keyname, char *keyvalue) tregistry *registry = new tregistry();registry-rootkey = root;registry-openkey(key, true);registry-writestring(keyname, (ansistring)keyvalue);delete registry; 我们可使用如下调用方法(获得windows墙纸文件名): ansistring wallpaperfilename = readstringfromreg(hkey_current_user,control paneldesktop, wallpaper, );三、 显示/隐藏任务栏图标 标准的windows应用程序运行时一般都会在任务栏上显示任务图标,用户可直接用鼠标点击任务栏图标进行任务切换,但有些应用程序不使用任务栏图标,如典型的office工具条,也有些程序可由用户定制显示方式显示或隐藏任务栏图标,如winamp。我们的程序中也可以做到,只要调用windows api函数setwindowlong即可,如下: / 隐藏任务栏图标:setwindowlong(application-

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论