structures in computer study?

My Friend faced an interview of IT company where they asked him Give Practical example of each data structure how this data structure can be used in computer study ??

Data Structures

  • Stack
  • Queue,Circular Queue
  • Linked List,Doubly Linked list,Circular Linked list
  • Tree,Binary Search Tree
  • Graph
  • Map and others like searching and sorting
  • (for example in Operating system for maintaing process queue [Queue data structure is used]like this for all others)

    Example Related to Software Implementation and Computer Science,Operating system etc.

    hoping for positive response


    Some examples:

  • Stack - Undo functions use this to pop most recent action off top of stack, then second most recent, etc.
  • Queue - Process Scheduling normally uses a queue (how processes or threads are accessed after the initial work varies though)
  • Tree - Directory traversal
  • Binary search tree - searching quickly for a given element
  • Graph - stores data so that you can think of it as a mathematical "plane" where the data is plotted. It is effective at representing (possibly) very complicated relationship between data, since (if you look at the image in the link) multiple "links" can exist between more than two pieces of data, as opposed to a linked list where you can only have a link to your left and to your right.
  • Hash map - Searching for certain blocks of memory (ie when using many pointers) Hashing occurs when you have, say, an address book on your computer. It might use a hash map so that when you enter John Smith, his phone number and other information are available. This is because there is a hashing function that points to a certain location in memory when "John Smith" is entered. It would be a headache entering a memory address every time you wanted to access some simple information.
  • Linked List - singly linked list offers movement in one direction between elements, doubly linked list offers movement back and forth between elements, and Circular linked list offers Circular navigation of similar objects (processes are one example) Use this when you want to be able to navigate between elements, because each element is linked to the next one and the one before it (for circular. noncircular linked lists have a beginning and an end). Imagine your web browser...you click "back" to go to the previous page, and you can click "forward" to go to the next. You can think of this as a linear linked list. A photo slide show that goes to the next or previous photo and then eventually starts at the beginning can be thought of as a circular linked list. (They're not necessarily implemented like that but it's a good way to visualize it)
  • Edited as per OP's request for more info on last structures.


    A queue is often used to save a group of data in an organized structure so that it is easily accessed immediately when needed since its a FIFO (First in first out). However; when filling information into that queue when that queue is FULL the rest of the information is lost. To combat this the circular queue is used, which overwrites the other elements so that recent data is NOT lost.

    An example of this like you mentioned would be the queue of resources of a computer. Because a computer does not have infinite resources a queue has to be used in order to allocate resources to those that need it. For instance a process would request some resources and it would be thrown into the queue and be given a priority level, based on this information the OS would then make a decision how much resources it needs and how much time it will be given. In order to allow multiple processes to make use of this, any process that has processing that needs to be done will put in a request in that queue.

    A linked list has many applications that its not really possible to simplify it into one one. For instance, you could link accounts (objects) through the queue of the nodes of a element in the linked list. In a linked list, a node has a previous and a next node. Which effectively links all the elements together so that they can be traversed. Depending on the style of the linked list, which allows forward traversal, backward traversal, or both directions. One thing to note is that a linked list can be dynamic in terms of size since all that needs to be done to add a new note is just attach it to the end of the list. However; in terms of performance the speed of that would be O(N) which means that the performance is heavily dependent on the size of the list.

    I hope this helps.


  • Stack - any recursive call
  • Queue,Circular Queue - all the FIFO algo use this
  • Linked List,Doubly Linked list,Circular Linked list - all the RDBMS
  • Tree,Binary Search Tree - Where searching is required. Memory is stored in B tree
  • Graph - google maps
  • 链接地址: http://www.djcxy.com/p/39872.html

    上一篇: 一些数据结构的示例应用程序

    下一篇: 计算机学习中的结构?