.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

There is a Parking Area having 2 wheelers and 4 wheelers slot separately. How to determine which data structure to use to search for next free slot quickly?

Posted By :Jean Paul     Posted Date :November 29, 2010    Points :10   Category :.NET Framework 
Use Stack

You can also find related Interview Question to There is a Parking Area having 2 wheelers and 4 wheelers slot separately. How to determine which data structure to use to search for next free slot quickly?  below: 

You have got 1 million parking slots. At a time a parking slot can be free or not. To get next slot easily which data structure to implement?

Use Stack.

If you use Stack, we can just get the next slot by using stack.Pop()

If you use List, we have to iterate through all list and check the status and retrieve.

So stack would be advantageous. (More...)

What is data structure?

A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data. (More...)

How is the data structure of System R different from the relational structure?

Unlike Relational systems in System R
1.Domains are not supported
2.Enforcement of candidate key uniqueness is optional
3.Enforcement of entity integrity is optional
4.Referential integrity is not enforced (More...)

Which is the suitable and efficient data structure to create a tree?

Linked list is the suitable and efficient data structure to create a tree. It will provide more flexibility. (More...)

What is Method used to bind the data into gridview ?

DataBind() Method used to bind the data into gridview (More...)

What is the .NET that allows the retrieval of data by a unique key?

HashTable is the .NET collection class that allows the retrieval of data by a unique key (More...)

What is managed code and managed data?

Managed code is code that is written to target the services of the Common Language Runtime (see What is the Common Language Runtime?). In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic.NET, and _JScript.NET code is managed by default. Visual Studio.NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Closely related to managed code is managed data-data that is allocated and de-allocated by the Common Language Runtime's garbage collector. C#, Visual Basic, and _JScript.NET data is managed by default. C# data can, however, be marked as unmanaged through the use of special keywords. Visual Studio.NET C++ data is unmanaged by default (even when using the /CLR switch), but when using Managed Extensions for C++, a class can be marked as managed by using the __gc keyword. As the name suggests, this means that the memory for instances of the class is managed by the garbage collector. In addition, the class becomes a full participating member of the .NET Framework community, with the benefits and restrictions that brings. An example of a benefit is proper interoperability with classes written in other languages (for example, a managed C++ class can inherit from a Visual Basic class). An example of a restriction is that a managed class can only inherit from one base class. (More...)

List out the areas in which data structures are applied extensively?

1.Compiler Design,
2.Operating System,
3.Database Management System,
4.Statistical analysis package,
5.Numerical Analysis,
7.Artificial Intelligence,
8.Simulation (More...)

What are the major data structures used in RDBMS, Network data model & Hierarchical data model.

RDBMS - Array (i.e. Array of structures)
Network data model - Graph
Hierarchical data model - Trees (More...)

What is the data structures used to perform recursion?

Stack. Because of its LIFO (Last In First Out) property it remembers its 'caller' so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls.
Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend