8 Replies - 2219 Views - Last Post: 22 June 2009 - 11:39 AM Rate Topic: -----

#1 aqshaf  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 77
  • Joined: 18-August 08

High Level language and data structure

Posted 17 June 2009 - 04:42 AM

Hey dear members I want your views on this statement.
Kindly
first read the statement, then read my views and then Add your precious ones......................and give a chance to say thanks..
StatementThis is to observed that in high level languages like c, c ++, and java, there is pretty good methods for memory managements for us. They do it automatically, then why we use data structure for memory management...
What do you say:

my remarks are:


At run time memory management is a task of high level language. Like delete method in C++ and garbage collector in Java. But for data storting and accessing, it doesn't provide efficient methods, for that we use data structure to store and access our data in timely manners.

Searching, storting algorithms are provided by data structure, not by any of high level language.

What are your remarks..??

Is This A Good Question/Topic? 0
  • +

Replies To: High Level language and data structure

#2 NickDMax  Icon User is online

  • Can grep dead trees!
  • member icon

Reputation: 2247
  • View blog
  • Posts: 9,237
  • Joined: 18-February 07

Re: High Level language and data structure

Posted 17 June 2009 - 05:37 AM

Well I find your post a little confused but I will try my best to give my opinion on what I see:

C/C++ and Java provide different levels of memory management functionality. C provides perhaps the least, and Java the most. In C a programmer must allocate memory directly using malloc() and must ensure that the memory is returned to the heap when it is no longer needed as C does not keep track of allocated memory for the programmer. C++ is not much better. However C++ does offer a little more structure in the terms of Objects, and the Objects do have deconstructers. So while the language itself does not offer much more help the OOP structure does. However, much of memory management is still up to the programmer.

Java on the other hand offers "automatic" memory management and will continue to scan for unused objects and release them back to the pool. This is nice since it frees the programmer in general from having to worry about freeing unused memory. BUT the programmer has very little control over memory management. This often leads to problems of its own -- such as really hard to locate memory leaks or object that are released before the programmer intends them to be.

All three languages provide support for sorting and searching. C++ and Java provide MANY data structures and offer many features for sorting and searching in these structures.

For example C++ STL has many data structures: vector, map, list, stack, queue, deque, etc.. And then it provides abstract algorithms capable of dealing with these containers: for_each, find_if, search, sort... etc.

Java takes things even father offering many refinements on classic data structures.

Even C contains the classic sorting and searching algorithms wrapped in general functions that use function pointers to customize the algorithm to the particular data you are sorting or searching.

So I would say that you should really take a better look at the high level languages and the features of their associated libraries as you seem to have things backwards: They probably offer less support for memory management then they do for data structures.
Was This Post Helpful? 1
  • +
  • -

#3 aqshaf  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 77
  • Joined: 18-August 08

Re: High Level language and data structure

Posted 21 June 2009 - 04:10 AM

First I would like to say thanks :)

You tell me in a nice way,
Yes I was not enable to convey my message actually, I wanted to say why we use data structure in high level languages, if data structure manage our memory then why the high level languages has given some tools on memory management.

In the prospective and including data structure in your discussion, I would like to get some guidelines from you..
Was This Post Helpful? 0
  • +
  • -

#4 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: High Level language and data structure

Posted 21 June 2009 - 10:11 AM

Quote

if data structure manage our memory then why the high level languages has given some tools on memory management
Data structures don't manage anything. They don't do anything. They are simply a way of organizing (structuring data), like trees, queues, stacks, etc. Based on that organization, various operations are possible with differing memory and time requirements.

That's about it.
Was This Post Helpful? 1
  • +
  • -

#5 r.stiltskin  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1833
  • View blog
  • Posts: 4,927
  • Joined: 27-December 05

Re: High Level language and data structure

Posted 21 June 2009 - 10:23 AM

Something about this topic does not make sense. There is really no meaningful connection between data structures and garbage collection/dynamic memory management. These are two separate topics.

I think maybe you are trying to answer a homework question along the lines of "why do we study data structures when high level languages like C++ and Java provide built-in container classes such as vectors, lists, maps, etc." Is that correct?
Was This Post Helpful? 1
  • +
  • -

#6 aqshaf  Icon User is offline

  • D.I.C Head

Reputation: 11
  • View blog
  • Posts: 77
  • Joined: 18-August 08

Re: High Level language and data structure

Posted 21 June 2009 - 11:55 PM

@ r.stiltskin

Thanks :)


@ r.stiltskin
Yes, your are right, it was my homework question.
You guessed not correctly, actually the topic for discussion were given to us was:
Generally, it may be observed that most high level languages manage the memory for us or in other words these languages provide us the facility of automatic memory management then why would you use Data Structures? Discuss.

well, thanks for all, you participate and furnish my concepts. I just want to get the precious and experienced advises from expertise.
Was This Post Helpful? 0
  • +
  • -

#7 armersuender  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 28-April 08

Re: High Level language and data structure

Posted 22 June 2009 - 05:33 AM

whoa.. I still don't know what going on in this thread, but it was highly entertaining! : )
Was This Post Helpful? 0
  • +
  • -

#8 NickDMax  Icon User is online

  • Can grep dead trees!
  • member icon

Reputation: 2247
  • View blog
  • Posts: 9,237
  • Joined: 18-February 07

Re: High Level language and data structure

Posted 22 June 2009 - 05:53 AM

Well then to answer your own question (rather than have us do it for you) think about what data structures are used FOR.

Does a stack help with memory management? Maybe a little -- but that is not the purpose of a stack -- a stack is a first in, last out data structure that allows us to interrupt one operation, complete another, and then return to the state we were at.

So if you think about it, each of the various data structures is associated with various algorithms that are used to solve different kinds of problems. So ask yourself: Why do we need data structures?

As r.stiltskin already pointed out -- it has little to do with memory management.
Was This Post Helpful? 0
  • +
  • -

#9 Yaminmaher  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 22-June 09

Re: High Level language and data structure

Posted 22 June 2009 - 11:39 AM

Dear,

Automatic memory management is a general term for techniques that automatically recycle unused memory.Automatic memory management is way to simplify our work , but it will not let you 100% sure that your program has gained the required targets, so we use data structure techniques to make it more suitable according to our requirments. data structure techniques also helps us , that how to struct our project for the given task or programming.
even , if you want to build a house , you will have to make a image or map to cover its construction in good manner , in this way , you will save your time and you can reuse your material during construction of a house !!
I hope , this will help you.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1