Monday, January 27, 2020

Advantages And Disadvantages Of Using A Pointer Computer Science Essay

Advantages And Disadvantages Of Using A Pointer Computer Science Essay Write advantages and disadvantages of using pointer. How the concept of pointers is useful in the implementation of data structures? A pointer allows a function or a program to access a variable outside the preview function or a program ,using pointer program can access any memory location in the computers memory. 2)since using return statement a function can only pass back a single value to the calling function, pointers allows a function to pass back more than one value by writing them into memory locations that are accessible to calling function. 3)Use of pointer increases makes the program execution faster 4)using pointers, arrays and structures can be handled in more efficient way. 5) without pointers it will be impossible to create complex data structures such as linked list , trees, and graphs. Disadvantages of pointers:- 1)we can access the restricted memory area. 2) Pointers require one additional dereference, meaning that the final code must read the variables pointer from memory, then read the variable from the pointed-to memory. This is slower than reading the value directly from memory. 3). If sufficient memory is not available during runtime for the storage of pointers, the program may crash When setting up  data ststructures  like  lists,  queues  and trees, it is necessary to have pointers to help manage how the structure is implemented and controlled.Pointers and Structures can be used to build data structures that expand and shrink during execution examples stack queues,trees etc.While pointer has been used to store the address of a variable,it more properly applies to data structures whose interface explicitly allows the pointer to be manipulated as a memory address.Because pointers allow largely unprotected access to memory addresses. 2). Elaborate the concept of Fixed block storage allocation and Buddy system in dynamic memory management. Sol. Fixed block storage allocation:- This is the simplest storage maintenance method. Here each block is of the same size. The size is determined by the system manager. Here the memory manager maintain a pointer AVAIL which points a list of non contiguous memory blocks. A user program communicate with the memory manager by means of two function GETNODE(NODE) and RETURNNODE(PTR).The procedure GETNODE is to get a memory block to store data of type NODE. This procedure when invoked by a program returns a pointer to first block in the pool of restorage. The AVAIL then points to the next block.If avail=NULL it indicates no more memory is available for allocation. Similarly whenever a memory block is no more required it can be returned to the memory bank through a procedure RETURN NODE(). Buddy system:- It is the another storage management system which restricts the size of blocks to some fixed set of sizes. These blocks of restricted sizes are maintained in a linked list. Whenever a request for a block of size N comes, the number M the smallest of the fixed sizes but equal to or largest than N, is determined and a block of size M is allocated if available on the list. If not available then a larger block if available is split into two sub-blocks known a s buddies. Each of them are also of fixed sizes and the process is repeated until a block of size M is produced. for example , if k=1 and Fo=8, then the block sizes are 8,16,32,64,128,à ¢Ã¢â€š ¬Ã‚ ¦. THAT is ,the block sizes are successive powers of 2; and the buddy system based on such fixed sizes is called binary buddy system. 3.)Differentiate between static memory allocation and dynamic memory allocation. Illustrate various memory management functions Sol. In case of static storage management scheme , the net amount of memory required for various data for a program is allocated before the starting of the execution of a program once memory is allocated, it neither can be extended nor can be returned to the memory bank for the use of other programs at the same time. On the other hand dynamic storage management schemes allows user to allocate and deallocate as per necessity during the execution of programs. The static storage allocation is easy to implement and efficient from execution point of view .Here all variables those are required for a program is allocated during compile time this is why static storage allocation is a compile time phenomena. In this each subprogram/subroutine of a program is compiled separately and the space required for them is reserved till the execution of the program. On the other hand dynamic memory allocation , space for memory variables is allocated dynamically that is as per the current demand during the execution. When a subprogram is invoked space for it is allocated and space is returned when the subprogram completes its execution. Thus , the space required to run a program is not fixed as in static allocation, rather it varies as program execute. Various memory management functions:- 1)malloc():-The malloc function dynamically allocates memory from heap.The prototype for malloc() function is Void *malloc(size_t size); 2)calloc():- The calloc() function dynamically allocates memory automatically initializes the memory to zeroes. The prototype for calloc() function is Void *calloc(size_t nitems , size_t size); It takes two arguments . The first argument is the number of elements and the second argument is the size of each element. 3) realloc():- The realloc() function changes the size of previously dynamically allocated memory with malloc(), calloc(), realloc() functions.The prototype for realloc() function is Void *realloc(void *block, size_t size); It takes two argument . the first argument is the pointer to the original object and the second argument is the new size of the object. 4.)Write different ways to manage records in memory Sol.) Since records may contain non homogeneous data, the elements of a record cannot be stored in an array . Some programming languages such as PASCAL and COBOL do have record structures built into the language. Suppose a programming language does not have available the hierarchical structures that are available in PASCAL and COBOL . Assuming the record contains non homogeneous data , the record may have to be stored in individual variables , one for each of its elementary data items. On the other hand one wants to store an entire file of records, such a file may be stored in memory as a collection of arrays that is, where elements in different arrays with the same subscript belonging to the same record. Part-B 1.)Illustrate the use of array of pointers and pointers to an array Sol.) An array of pointers is that for eg if we have array of 10 int pointers ie int *a[10] then each element that which is stored in array are pointed by pointers. here we will have ten pointers. In pointer to an array for eg int(*a)[10] here all the elements that is all the ten elements are pointed by a single pointer. int *a[10]:-array of pointers. consider one array int b[10]={1,2,3,4,5,6,7,8,9,0};so elements will be stored in addresses .now this address are stored in array of pointers.thats int *a[10]={b+0,b+1,b+2,b+3,b+4,b+5,b+6,b+7,b+8,b+9};means a+0=address of value 1 is the first element of int *a[](first element of int b[10])and so on. while int(*a)[10]:-here a is an pointer to an array containing 10 integers. suppose int b[10]; then a=b[10]; this will give element of int b[10] array thats b[0];and so on but in case of two dimensional array first we have to allocate base address of respective one dimensional array and base address of element of one dimensional array then only we can use pointer to an array. Give example to show the use of far pointer and dangling pointer problems Sol.) A far pointer uses both the segment and the offset address to point to a location in memory   The far pointer can point to any location in memory. . Far pointers have a size of 4 bytes . They store both the segment and the offset of the address the pointer is referencing. A far pointer has an address range of 0 1M bytes. A far pointer can be incremented and or decremented Only the offset of the pointer is actually incremented or decremented. The segment is never incremented by the arithmetic operators.On the other hand Dangling pointers are the pointers that do not point tao a valid object of the appropriate type. These pointers arise when an object is deleted or deallocated,without modifting the value of the pointer so that pointer stll points to the memory location of deallocated memory .As the system may reallocate the previously freed memory to another process ,if the original program then derefrences the dangling pointer,results in bugs or errors as the memory may contain com pletely different data.   Consider the following example { char *cp = NULL; { char c; cp = &c; }    /* cp is now a dangling pointer */ } Solution to dangling pointer: char *cp = malloc ( A_CONST ); free ( cp ); /* cp now becomes a dangling pointer */ cp = NULL; /* cp is no longer dangling */ Differentiate between linked list and arrays in terms of representations, traversal and searching. Sol.) 1)In case of array traversing is used visiting all elements in an array while to traverse a single linked list we mean to visit every node in the list starting from first node to last node. 2).Searching operation in an array is applied to search an element interest in an array.It is a process of finding the location of given element in an array.The search is said to be successful if the given element is found.there are two types of search operation : Linear search Binary search If the array elements are in random order then one have to use linear search technique and if the array elements are sorted then it is preferable to choose binary search technique.While in case of linked list only linear searching is possible.This is one of the limitation of linked lists as there is no way to find the location of the middle element of the list. can we perform binary search in linked list ,if no then illustrate the reason. Sol.) No, we cannot perform binary search in linked list because there is no way Of indexing the middle element in the list. With a sorted linear array we can apply a binary search whose running time is proportional to log2n. On the other hand a binary search algorithm cannot be applied to a sorted linked list, since there is no way of indexing the middle element in the list. This property is one of the main drawbacks in using a linked list as a data structure.

Sunday, January 19, 2020

the role of the church in the Kosovo crisis :: essays research papers

After the Dayton peace accords in 1995, terminating the civil war in Bosnia-Hercegovina, the attention of the world turned to Kosovo. The international agreement terminating the Bosnian War ignored the problems of Kosovo, where the Albanian majority claimed independence. As their complaints were not addressed, the Kosovars turned from a policy of passive resistance of their moderate leadership to guerilla tactics and violent acts against the Serbian authorities conducted by the Kosovo Liberation Army (KLA). Their activities prompted the State Department to label them a "terrorist group" in February 1998. A year later, however, the Western powers invited the KLA, not the previous moderate leaders, to represent Kosovo at Rambouillet. As our subject is the role played by the Serbian Church under the leadership of Patriarch Pavle, we will stress its activities here. Among the spokesmen we must single out Bishop Artemije of the Raska-Prizren Diocese, who has been particularly articulate in expressing the views of the church in Kosovo. We must also mention Father Sava of Decani, who speaks English, commands the computer, and has played a crucial role in outreach. The church assembly convened in Prizren in August 1997 criticized the activities of the Serbian special forces as well as of the Albanian KLA. As for the KLA aim of independence for Kosovo, they warned that this "would immediately produce large scale instability in the whole region, resulting in a disastrous multiethnic war." The church urged that ethnic Albanians would be able to find a satisfactory status in a "democratic Serbian state." They recognized that this ideal was far from the Milosevic regime. By 1998, the conflict was in full force. Church spokesmen repeatedly criticized the excessive use of force by the Milosevic police and paramilitaries in Kosovo, but also denounced the KLA, which had started murdering Serbian policemen and ethnic Albanians who they thought were cooperating with Serbian authorities. They strongly condemned the role of the KLA in abducting civilians. Three months before bombing started, the KLA clearly had already declared war on the Serbs in Kosovo. In February 1999, the international community called a meeting in Rambouillet, outside Paris, to stop he conflict. The negotiators were dealing with the self-appointed KLA leaders and representatives sent by Milosevic. As the representative of the Patriarch, Bishop Artemije tried to reach the negotiators. He tried to represent the viewpoint of the local Serbian population and the church in this ecclesiastical center, even to be an observer, but was rebuffed by Milosevic and by the diplomats.

Saturday, January 11, 2020

Philosophy of coaching

Many coaches have their own philosophy to live by. Some coaches are to win, some are to teach the players to be responsible, and some are to allow the players to Just have fun. When the word philosophy comes to mind I immediately think of the words and accomplishments a coach should live by. My coaching philosophy is one that is not fully developed. Right now my philosophy is to win but at the same time teach my players to be responsible. Of course everything is easier in words than it is to follow UT in actions.The way I plan to do this is by having the players become dedicated to the program and in the classroom. Grade checks will be sent out every week and attendance will be taking every day at practice. If a player has a G. P. A under a 2. 5 they will have to continue to get grade checks until the end of the year. If a player misses morning weights they will have to run at practice unless it is an excused miss. Also if they miss an afternoon practice they will out a quarter for e ach day they miss.Doing all of these I believe I can have a group of responsible young men eager to play and excited to win. With all the hard work there will be time for play. Every day there will a competition between offense and defense or lard buts and skinny farts. Winner will be able to get out of conditions for the day. These are all the things I plan to do when I am a coach. I believe if I use these guidelines to start off my career I can build my philosophy to become a great coach.

Friday, January 3, 2020

Year Land Size West Bank Share Essay - 1011 Words

Year Land Size West Bank Share (%) 1967 527 9.3 1973 700 12.4 1984 1800 31.9 1993 2500 44.3 1995 2557 45.3 1998 2729 48.4 2000 2760 48.9 Source: The 1967, 1973 and 1984 data-points are from Benvenisti and Khayat (1988). The 1993 datapoint is from Maariv, Jan 22, 1993 and B’Tselem (1997). The 1995, 1998, and 2000 data points are based on Ha’aretz, Jul 20, 2000 and Isaac and Ghanyem (2001). The shares data are computed based on the West Bank land area of 5640 km2 (World Fact-Book, 2001). Israeli governments have supported settlers in various ways, including providing them land, cheap mortgages, tax reductions, grants, subsidies and employment and deplying IDF to guard settlements. In per capita terms, the government has invested more in the settlements than in Israel propers. In the 1990s for example, 5.3 m of road per person were paved in Israel proper. compared with 17.2 m in the territories. One of the core demands of the Palestinian negotiators at Oslo and at Camp David ( in the late 1990s) was that Jewish settlements be evacuated. An evacuation seemed manageable. Prime minister Rabin and believed that settlements had no security value. Prime Minister Barak and Peres also wanted to evacuate settlements. But during the Oslo process, the Labor government. tried to show they were pro-settler. The reason was the fear of an Israeli civil was according to Reuveny. In 1988, the Palestinians gave up 78% of the historic Palestine in return for the de facto recognitionShow MoreRelatedWater Issues Between Urbanization And Agriculture873 Words   |  4 Pages Water Issues between Urbanization and Agriculture in the American West in the Twentieth and the Twenty First Century. Water rights have been in many research articles over the years as well as current day. Why they are in that respect, what states have them, and how water rights affect modern day American westerners. Dellapenna (2014) spoke of what ought to be known about water rights, she pronounced that there are two main types of rights. The first category that is stationed in theRead MoreGovernment Of Indi The Four Distributional Aspects Of Agricultural Credit Essay1487 Words   |  6 Pagesinstitutional credit. It is true that there have been some improvements in flow of farm credit in recent years. However, the Government has to be sensitive to the four distributional aspects of agricultural credit. These are: (a) not much improvement in the share of small and marginal farmers . (b) decline in credit-deposit (CD) ratios of rural and semi-urban branches. (c) increase in the share of indirect credit in total agricultural credit and. (d) significant regional inequalities in credit. (PoliciesRead MoreAmerican Free Trade Agreement ( Nafta ) And Mercosur Essay1559 Words   |  7 Pagesexpand exportations. In a country small like Belize, exportations are decreasing dramatically and importations will continue to increase. The Bank of Guyana has also reported that the country’s exportations are higher than importations (Guyana Exports) People do not only live off economics alone, people also part of society; and the Caribbean society all share similar history, culture and traditions. Integration helps to create a sense of Common Identity (Premdas). Common Identity occurs when an individualRead MoreReasons For The Country Of Iraq1505 Words   |  7 Pages This essay is going to cover the country of Iraq. Due to my experience with three deployments to this country, I have found its history very interesting. I will share knowledge and facts about the Country, culture and military. This country has an astounded religious and cultural history documented. I believe Iraq was once self sufficient because of its Dictator however a great threat to the world. Sometimes I am very puzzled how we successfully invaded the country and changed theirRead MoreAchievements Of The Han Dynasty973 Words   |  4 Pagesgovernment, China’s army was massive. Under the rule of Han Martial Emperor (141-87B.C.E), the e mpire expanded its army 3000 miles east to west and 2000 miles north to south encompassing 60 million people. This expansion included North Vietnam, Northern Korea, southern Manchuria and west into Central Asia. Unfortunately, the amount of taxes needed to keep an army this size supported drained the Chinese resources. Revolts and raids plagued the empire and in 9c.e, Wang Mang was put in place after a coupRead MoreThe Syrian Arab Country Of Syria1276 Words   |  6 PagesSyrian Arab Republic is mainly located in south East Asia, bordering on the east with Iraq (599 km), on the South west with Israel (83 km) Jordan (379 km) and Lebanon (403 km) on the north with Turkey (899 km) total boundaries 2,363 km Syria is slightly more than 1.5 times the size of Pennsylvania2 Also, the country shares 193 km coastline on the Mediterranean Sea. total: 185,180 square km, land: 183,630 square km, water: 1,550 square km, includes 1,295 square km of Israeli-occupied territory. Read MoreThe War Between France And Great Britain998 Words   |  4 Pagesfor profit. No profit came of the search, instead diseases and famine were major problems faced by colonists. 2: 1754; The French and Indian War took place between 1754 and 1763. The war between France and Great Britain started after a dispute about land that the British wanted from the French. It angered them and some native Indian tribes. 3: 1773; British colonists began to become upset with all the new taxes imposed on them by Great Britain to pay for the debt of the French and Indian war. A groupRead MoreEssay on The Scramble for Africa1662 Words   |  7 Pageshistory. Europe alone managed to colonize the entire African continent in a period of roughly twenty five years, spanning from 1875 to 1900. The quest for power by European nations was only one of the driving forces for this race for colonization. The geographical location and the natural resources to be exploited in certain regions of the continent were important factors in the race for land. Another factor that contributed to the colonization of Africa was the end of the slave trade. The need forRead MoreLong-Distance Trade And Economic Development.. Many Countries1746 Words   |  7 Pagesideas that would encourage either growth or change. They were bound by old traditions that were hard to ignore but this also created a situation whereby these countri es were literally bursting at the seam for new ideas and growth. Finally ignoring years of isolationism, Chinese and European hierarchies slowly began financing various expeditions seeking not only to become trading partners with other countries, but also looking for new territories to explore and settle. These expeditions slowly beganRead MoreCompany Profile Of National Thermal Power Plant Essay1392 Words   |  6 PagesINRODUCTION NTPC, the largest power Company in India, was setup in 1975 to accelerate power development in the country. It is among the world’s largest and most efficient power generation companies. In Forbes list of World’s 2000 Largest Companies for the year 2007, NTPC occupies 411th place. NTPC has installed capacities of 29,394 MW. It has 15 coal based power stations (23,395 MW), 7 gas based power stations (3,955 MW) and 4 power stations in Joint Ventures (1,794 MW). The company has power generating